Full Text Search Configuration

The Full Text Search Configuration page enables visual editing of the fts.xml configuration file.

If the Include configuration of the app components checkbox is on, the cuba.ftsConfig application property will include configuration files from app components. If you switch it off, the entities from the app components will not be indexed until you add them to your project's FTS configuration.

The Entities list contains indexed entities. Select one and edit settings in the right panel.

The Include table defines rules for including entity attributes into index. By default, all local (not reference) attributes are indexed by providing the .* regular expression. You can also include attributes separately by providing their names in rows of type Property. Press Ctrl+Space in the input field to see possible attribute names.

The Exclude table defines rules for excluding entity attributes previously included by Include rules. If you exclude individual properties, you can press Ctrl+Space in the input field to see possible attribute names.

In the Searchables field, you can specify a Groovy script to add arbitrary entities associated with the changed one to the indexing queue. The following objects are passed into the script at invocation:

For example:
searchables.add(entity.card)

The Searchable if field allows you to specify a Groovy script to exclude certain instances of the indexed entity from the queue. When running the script, the entity variable (the current entity instance) is passed into it. The script should return a boolean value: true if the current instance should be indexed, and false otherwise. For example:

entity.versionOf == null

The Searchables and Searchable if fields support code completion by pressing Ctrl+Space.

Warning: defining the configuration is not enough to get Full Text Search working in your application. You should also do the following:

  1. Run the application, open Administration > JMX Console screen, find the app-core.fts:type=FtsManager JMX bean, open the Enable attribute and check the Value checkbox.
  2. Re-login to the application, open the same JMX bean again and consequently invoke reindexAll() first and then processQueue() to index existing entities.
  3. In order to process the indexing queue periodically, setup a scheduled task invoking the processQueue() method of the cuba_FtsManager bean.