1.1. Indexing

If the FTS add-on is added to the application, and the fts.enabled property is enabled, then each time when an indexable entity is being saved to the database its identifier gets added to the indexing queue – SYS_FTS_QUEUE table.

To have the indexing process running automatically in the background, the scheduled task needs to be created and activated. Then separate asynchronous process periodically extracts identifiers of changed entities from the queue, loads entity instances and indexes them. Indexing is performed using the Apache Lucene library. Lucene document contains the following fields:

  • Entity name and instance identifier.

  • all – concatenation of the entity attributes being indexed, which includes only local and FileDescriptor type attributes. If the attribute has FileDescriptor type, the system will index the content of the corresponding file. Local attributes may have the following types: string, number, date, enumeration.

  • links – concatenation of entities identifiers contained in indexed attributes having a reference type.

Indexed attributes are the attributes of the entity and related entities (if any), which are declared in the FTS descriptor.

Index is stored in the file system; by default, it is located in the ftsindex subfolder of the application work folder (defined by the cuba.dataDir property); for a standard deployment, this folder is tomcat/work/app-core/ftsindex. Index location can be changed using the fts.indexDir property.