Package io.jmix.search.index
Interface ESIndexManager
- All Known Implementing Classes:
ESIndexManagerImpl
public interface ESIndexManager
Provides functionality for index management.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
createIndex
(IndexConfiguration indexConfiguration) Creates index if not exists using providedIndexConfiguration
.boolean
Drops index by name.org.elasticsearch.client.indices.GetIndexResponse
Requests info about index from ES cluster.boolean
isIndexExist
(String indexName) Checks if index exists.boolean
recreateIndex
(IndexConfiguration indexConfiguration) Drops and creates search index using providedIndexConfiguration
.Drops and creates all search indexes.recreateIndexes
(Collection<IndexConfiguration> indexConfigurations) Drops and creates search indexes using provided collection ofIndexConfiguration
.synchronizeIndexSchema
(IndexConfiguration indexConfiguration) Synchronizes schema of search index for providedIndexConfiguration
.Synchronizes schemas of all search indexes defined in application.synchronizeIndexSchemas
(Collection<IndexConfiguration> indexConfigurations) Synchronizes schemas of search indexes for provided collection ofIndexConfiguration
.validateIndex
(IndexConfiguration indexConfiguration) Validates current state of index schema.Validates current state of schema of all search indexes defined in application.validateIndexes
(Collection<IndexConfiguration> indexConfigurations) Validates current state of index schema related to provided collection ofIndexConfiguration
.
-
Method Details
-
createIndex
Creates index if not exists using providedIndexConfiguration
.- Parameters:
indexConfiguration
- index configuration- Returns:
- true if index was successfully created, false otherwise
-
dropIndex
Drops index by name.- Parameters:
indexName
- index name- Returns:
- true if index was successfully dropped, false otherwise
-
recreateIndexes
Map<IndexConfiguration,Boolean> recreateIndexes()Drops and creates all search indexes.- Returns:
- Map with operation result per every index configuration
-
recreateIndexes
Drops and creates search indexes using provided collection ofIndexConfiguration
.- Parameters:
indexConfigurations
- index configurations- Returns:
- Map with operation result per every index configuration
-
recreateIndex
Drops and creates search index using providedIndexConfiguration
.- Parameters:
indexConfiguration
- index configuration- Returns:
- true if index was successfully recreated, false otherwise
-
isIndexExist
Checks if index exists.- Parameters:
indexName
- index name- Returns:
- true if index exists, false otherwise
-
validateIndexes
Map<IndexConfiguration,IndexValidationStatus> validateIndexes()Validates current state of schema of all search indexes defined in application.- Returns:
IndexValidationStatus
per eachIndexConfiguration
-
validateIndexes
Map<IndexConfiguration,IndexValidationStatus> validateIndexes(Collection<IndexConfiguration> indexConfigurations) Validates current state of index schema related to provided collection ofIndexConfiguration
.- Parameters:
indexConfigurations
- actual configurations- Returns:
IndexValidationStatus
per eachIndexConfiguration
-
validateIndex
Validates current state of index schema.- Parameters:
indexConfiguration
- actual configuration- Returns:
IndexValidationStatus
-
getIndex
Requests info about index from ES cluster.- Parameters:
indexName
- index name- Returns:
- response
-
synchronizeIndexSchemas
Map<IndexConfiguration,IndexSynchronizationStatus> synchronizeIndexSchemas()Synchronizes schemas of all search indexes defined in application.- Returns:
IndexSynchronizationStatus
per eachIndexConfiguration
-
synchronizeIndexSchemas
Map<IndexConfiguration,IndexSynchronizationStatus> synchronizeIndexSchemas(Collection<IndexConfiguration> indexConfigurations) Synchronizes schemas of search indexes for provided collection ofIndexConfiguration
.- Parameters:
indexConfigurations
- actual index configurations- Returns:
IndexSynchronizationStatus
per eachIndexConfiguration
-
synchronizeIndexSchema
Synchronizes schema of search index for providedIndexConfiguration
.It tries to update schema to the actual state according to
IndexSchemaManagementStrategy
defined by 'jmix.search.indexSchemaManagementStrategy' application property.- Parameters:
indexConfiguration
- actual index configuration- Returns:
IndexSynchronizationStatus
-