Package io.jmix.search.index.impl
Class BaseIndexManager
java.lang.Object
io.jmix.search.index.impl.BaseIndexManager
- All Implemented Interfaces:
IndexManager
- Direct Known Subclasses:
ElasticsearchIndexManager
,OpenSearchIndexManager
Contains non-platform-specific operations.
Interaction with indexes is performed in platform-specific implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IndexConfigurationManager
protected final IndexStateRegistry
protected final com.fasterxml.jackson.databind.ObjectMapper
protected final SearchProperties
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseIndexManager
(IndexConfigurationManager indexConfigurationManager, IndexStateRegistry indexStateRegistry, SearchProperties searchProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected IndexSynchronizationStatus
handleIrrelevantIndex
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) protected IndexSynchronizationStatus
handleMissingIndex
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) protected abstract boolean
isIndexActual
(IndexConfiguration indexConfiguration) protected boolean
nodeContains
(com.fasterxml.jackson.databind.node.ObjectNode containerNode, com.fasterxml.jackson.databind.node.ObjectNode contentNode) 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
.protected IndexSynchronizationStatus
synchronizeIndexSchema
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) 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
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.search.index.IndexManager
createIndex, dropIndex, getIndexMetadata, isIndexExist
-
Field Details
-
indexConfigurationManager
-
indexStateRegistry
-
searchProperties
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
MAP_TYPE_REF
-
-
Constructor Details
-
BaseIndexManager
protected BaseIndexManager(IndexConfigurationManager indexConfigurationManager, IndexStateRegistry indexStateRegistry, SearchProperties searchProperties)
-
-
Method Details
-
recreateIndexes
Description copied from interface:IndexManager
Drops and creates all search indexes.- Specified by:
recreateIndexes
in interfaceIndexManager
- Returns:
- Map with operation result per every index configuration
-
recreateIndexes
public Map<IndexConfiguration,Boolean> recreateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManager
Drops and creates search indexes using provided collection ofIndexConfiguration
.- Specified by:
recreateIndexes
in interfaceIndexManager
- Parameters:
indexConfigurations
- index configurations- Returns:
- Map with operation result per every index configuration
-
recreateIndex
Description copied from interface:IndexManager
Drops and creates search index using providedIndexConfiguration
.- Specified by:
recreateIndex
in interfaceIndexManager
- Parameters:
indexConfiguration
- index configuration- Returns:
- true if index was successfully recreated, false otherwise
-
validateIndexes
Description copied from interface:IndexManager
Validates current state of schema of all search indexes defined in application.- Specified by:
validateIndexes
in interfaceIndexManager
- Returns:
IndexValidationStatus
per eachIndexConfiguration
-
validateIndexes
public Map<IndexConfiguration,IndexValidationStatus> validateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManager
Validates current state of index schema related to provided collection ofIndexConfiguration
.- Specified by:
validateIndexes
in interfaceIndexManager
- Parameters:
indexConfigurations
- actual configurations- Returns:
IndexValidationStatus
per eachIndexConfiguration
-
validateIndex
Description copied from interface:IndexManager
Validates current state of index schema.- Specified by:
validateIndex
in interfaceIndexManager
- Parameters:
indexConfiguration
- actual configuration- Returns:
IndexValidationStatus
-
synchronizeIndexSchemas
Description copied from interface:IndexManager
Synchronizes schemas of all search indexes defined in application.- Specified by:
synchronizeIndexSchemas
in interfaceIndexManager
- Returns:
IndexSynchronizationStatus
per eachIndexConfiguration
-
synchronizeIndexSchemas
public Map<IndexConfiguration,IndexSynchronizationStatus> synchronizeIndexSchemas(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManager
Synchronizes schemas of search indexes for provided collection ofIndexConfiguration
.- Specified by:
synchronizeIndexSchemas
in interfaceIndexManager
- Parameters:
indexConfigurations
- actual index configurations- Returns:
IndexSynchronizationStatus
per eachIndexConfiguration
-
synchronizeIndexSchema
Description copied from interface:IndexManager
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.- Specified by:
synchronizeIndexSchema
in interfaceIndexManager
- Parameters:
indexConfiguration
- actual index configuration- Returns:
IndexSynchronizationStatus
-
isIndexActual
-
synchronizeIndexSchema
protected IndexSynchronizationStatus synchronizeIndexSchema(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) -
handleIrrelevantIndex
protected IndexSynchronizationStatus handleIrrelevantIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) -
handleMissingIndex
protected IndexSynchronizationStatus handleMissingIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) -
nodeContains
protected boolean nodeContains(com.fasterxml.jackson.databind.node.ObjectNode containerNode, com.fasterxml.jackson.databind.node.ObjectNode contentNode)
-