FTS Best Practice

Hi Cuba Community,

We have a project deployed to an AWS beanstalk as single war deployments over two instances with a single database. FTS was setup and it returns results if I am on one server but no results for the same search string if I am logged into the other.

Is a sync on each individual Tomcat server required to back fill previous data in the database for FTS to work?

Are there any other considerations for this setup to ensure that search returns results for new and old data on both servers?

Appreciate the insights!


The recommendations for multi-instance cluster are the following:

  • For each of the CUBA app-core app instance the Lucene index is stored locally in the file system. Indexes are maintained independently from each other. When using BeansTalk or other cloud deployment, make sure that index storage directory Appendix B: Application Properties - CUBA Platform. Full Text Search is writeable.
  • When new the application instance is deployed, you will need to initialize Lucene index on this instance (or just copy files from the ftsindex folder on another instance).
  • It’s necessary to setup system settings, so that indexing is triggered on all cluster instances.
  1. Set application property fts.indexingHosts (com.haulmont.fts.global.FtsConfig#getIndexingHosts), it contains list of cluster instance IDs, where indexing should be run, separated with vertical line letter.
    E.g. fts.indexingHosts = app1:8080/app-core|app2:8080/app-core|app3:8080/app-core
  2. Set up scheduled task for indexing (Настройка вызова процесса индексирования - Платформа CUBA. Полнотекстовый поиск), to make it executed in cluster.
    cuba_FtsManager - processQueue - should be executed on all cluster nodes. Settings are the e.g. the following:
  • Singleton = false
  • Log Start, Log Finish = true
  • Permitted Servers - empty value; or enumeration of all app-coe instance IDs, comma separated , e.g. app2:8080/app-core,app1:8080/app-core.
  • Period = 5 or 10 seconds
  • Active = true
  1. On all cluster instances execute reindexing (Запуск и настройка переиндексации сущностей - Платформа CUBA. Полнотекстовый поиск), or copy index from one instance to all others.
1 Like

Hi Alexander,

That worked! - Thank you for your assistance.