1.1. Indexing
If the FTS base project is included as base project in 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.
A 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 andFileDescriptor
type attributes. If the attribute hasFileDescriptor
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 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.