2.3. Setting up Configuration File

Create the fts.xml file with the following content in the source text directory of the core module:

<fts-config>
    <entities>

        <entity class="com.sample.library.entity.Author">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.Book">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.BookInstance">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.BookPublication">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.LibraryDepartment">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.LiteratureType">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.Publisher">
            <include re=".*"/>
        </entity>

        <entity class="com.sample.library.entity.Town">
            <include re=".*"/>
        </entity>

    </entities>
</fts-config>

This is the FTS configuration file, which in our case enables indexing of all domain model entities with all their attributes.

Add the following property to the app.properties file of the application core module:

cuba.ftsConfig = cuba-fts.xml fts.xml

As a result, indexing will include both the entities defined in the platform’s cuba-fts.xml and the project’s fts.xml files.

Restart the application server. From now on, full text search should work for all entities of the application model as well as entities of the platform security subsystem: Role, Group, User.