3.1. Project Setup

  1. Download and unzip the source repository of the library application, or clone it using git:

      git clone https://github.com/cuba-platform/sample-library-cuba7
  2. Open the Library project as described in the Opening an Existing Project section of the CUBA Studio User Guide.

  3. Add the Full Text Search add-on to your project via CUBA Add-Ons window as described in the Installation section.

  4. Create the database on the local HyperSQL server: click CUBACreate database main menu item.

  5. Run the application: click the run_button button next to the selected CUBA Application configuration in the main toolbar. The link in the Runs at…​ section of the CUBA project tree will help to open the application in a web browser directly from Studio.

  6. Open the library application.

    The username and password are admin / admin.

  7. To enable full-text search functionality, open AdministrationApplication properties in the application main menu, find and open the fts list of properties in the table. Open the fts.enabled property using double-click and select true in the Current value field.

    fts enabled true
    Figure 2. fts.enabled property

Once the steps above are completed, full-text search functionality will be added to the application and ready to work. If you log out of the system and then log in again, a search field will appear in the top right panel of the main application window. Full-text search can also be used in the Filter UI component.

However, search will not produce any results because the data has not been indexed yet.

To start one-off indexing of the current state of the database (i.e. the entities listed in the FTS configuration file by default), open the AdministrationJMX Console, find the app-core.fts:type=FtsManager JMX bean and consequently invoke reindexAll() first and then processQueue().

jmx fts setup
Figure 3. JMX Setup

After this, searching the "adm" string should give the following results:

2.1 project setup
Figure 4. Search Results