2.1. Project Setup

  1. Run CUBA Studio, go to Open projectSamples window and download the Library project.

  2. Open the Library project in Studio.

  3. Open Project propertiesEdit, include the fts project in the list of Base projects and save changes. Confirm action after Studio will suggest recreating Gradle scripts.

  4. Select RunDeploy. At this point, the application will be assembled and deployed to the Tomcat application server located at build/tomcat.

  5. Create the application database: RunCreate database.

  6. Start the application server: RunStart application server.

  7. Open the application’s web-interface at http://localhost:8080/app. Log into the system with the name admin and password admin.

  8. To enable full text search functionality, open AdministrationJMX Console in the application main menu, find and open the app-core.fts:type=FtsManager JMX bean. Open the Enable attribute using double click and check the Value checkbox.

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. 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 app-core.fts:type=FtsManager JMX bean again and consequently invoke reindexAll() first and then processQueue(). After this, searching the "adm" string should give the following results:

SearchResults1