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:
searchables
- the list of entities that should be appended.entity
- the current entity instance, which is being added to the queue automatically.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:
app-core.fts:type=FtsManager
JMX bean, open the Enable attribute and check the Value checkbox.reindexAll()
first and then processQueue()
to index existing entities.processQueue()
method of the cuba_FtsManager
bean.