Search Configuration Options
The Search add-on checks the current configuration of Elasticsearch indexes and compares it to the expected ones. Further actions depend on the selected Index Schema Management Strategy:
create-only- every missing index will be created, existing indexes with irrelevant configuration will be kept as is.
create-or-recreate- every missing index will be created, existing indexes with irrelevant configuration will be recreated (all data will be lost). This is the default strategy.
The strategy can be configured by adding the following property to your
jmix.search.indexSchemaManagementStrategy = create-only
The index schema synchronization is automatically performed on application startup. Besides, it can be manually performed using
synchronizeXXX operations of EntityIndexing MBean.
The EntityIndexing MBean also contains the
recreateIndex operation. It drops and creates index without taking into account the current Index Schema Management Strategy, even if the target index has an actual configuration. All index data will be lost.
Search indexes have the following naming template:
Default prefix is
If multiple projects use the same Elasticsearch service, you should ensure that index names are unique: all projects should have unique entity names or projects should have different prefixes.
Prefixes can be configured by adding the following property to your
jmix.search.searchIndexNamePrefix = sample_prefix_
There are two approaches to existing data indexing:
Automatic - is a part of the index schema synchronization and enabled by default. It enqueues all instances of each entity whose index has been created (in the background process). Automatic indexing can be enabled for specific entities only.
Manual - by using the
enqueueIndexAlloperation of EntityIndexing MBean.
To enable automatic indexing for specific entities, add the following application property:
jmix.search.enqueueIndexAllOnStartupIndexRecreationEntities = search_Order,search_Customer
Also, you can completely disable automatic indexing by adding the following application property:
jmix.search.enqueueIndexAllOnStartupIndexRecreationEnabled = false