Package io.jmix.search.index
Interface IndexManager
- All Known Implementing Classes:
BaseIndexManager
,ElasticsearchIndexManager
,OpenSearchIndexManager
public interface IndexManager
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.com.fasterxml.jackson.databind.node.ObjectNode
getIndexMetadata
(String indexName) Requests info about index from server.boolean
isIndexExist
(String indexName) Checks if index exists.boolean
putMapping
(String indexName, IndexMappingConfiguration mapping) Saves mapping to index on the search server or servers cluster.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
-
getIndexMetadata
Requests info about index from server.- Parameters:
indexName
- index name- Returns:
- response as Json
-
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
-
putMapping
Saves mapping to index on the search server or servers cluster.- Parameters:
indexName
- name of the index for saving mappingmapping
- mapping for saving to configuration of the specified index- Returns:
- true if saving process was performed successfully.
-