2.1. Project Setup
-
Run CUBA Studio, go to Open project → Samples window and download the Library project.
-
Open the Library project in Studio.
-
Open Project properties → Edit, select the fts component in the list of App components and save changes. Confirm when Studio suggests recreating Gradle scripts.
-
Select Run → Deploy. At this point, the application will be assembled and deployed to the Tomcat application server located at build/tomcat.
-
Create the application database: Run → Create database.
-
Start the application server: Run → Start application server.
-
Open the application’s web-interface at
http://localhost:8080/app
. Log into the system with the nameadmin
and passwordadmin
. -
To enable full text search functionality, open Administration → Application 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.
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 Administration → JMX Console, find the app-core.fts:type=FtsManager
JMX bean and consequently invoke reindexAll()
first and then processQueue()
.
After this, searching the "adm" string should give the following results: