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 IndexConfigurationManagerprotected final IndexStateRegistryprotected final com.fasterxml.jackson.databind.ObjectMapperprotected final SearchProperties -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseIndexManager(IndexConfigurationManager indexConfigurationManager, IndexStateRegistry indexStateRegistry, SearchProperties searchProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected IndexSynchronizationStatushandleIrrelevantIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) protected IndexSynchronizationStatushandleMissingIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) protected abstract booleanisIndexActual(IndexConfiguration indexConfiguration) protected booleannodeContains(com.fasterxml.jackson.databind.node.ObjectNode containerNode, com.fasterxml.jackson.databind.node.ObjectNode contentNode) booleanrecreateIndex(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 IndexSynchronizationStatussynchronizeIndexSchema(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, waitMethods 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:IndexManagerDrops and creates all search indexes.- Specified by:
recreateIndexesin interfaceIndexManager- Returns:
- Map with operation result per every index configuration
-
recreateIndexes
public Map<IndexConfiguration,Boolean> recreateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManagerDrops and creates search indexes using provided collection ofIndexConfiguration.- Specified by:
recreateIndexesin interfaceIndexManager- Parameters:
indexConfigurations- index configurations- Returns:
- Map with operation result per every index configuration
-
recreateIndex
Description copied from interface:IndexManagerDrops and creates search index using providedIndexConfiguration.- Specified by:
recreateIndexin interfaceIndexManager- Parameters:
indexConfiguration- index configuration- Returns:
- true if index was successfully recreated, false otherwise
-
validateIndexes
Description copied from interface:IndexManagerValidates current state of schema of all search indexes defined in application.- Specified by:
validateIndexesin interfaceIndexManager- Returns:
IndexValidationStatusper eachIndexConfiguration
-
validateIndexes
public Map<IndexConfiguration,IndexValidationStatus> validateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManagerValidates current state of index schema related to provided collection ofIndexConfiguration.- Specified by:
validateIndexesin interfaceIndexManager- Parameters:
indexConfigurations- actual configurations- Returns:
IndexValidationStatusper eachIndexConfiguration
-
validateIndex
Description copied from interface:IndexManagerValidates current state of index schema.- Specified by:
validateIndexin interfaceIndexManager- Parameters:
indexConfiguration- actual configuration- Returns:
IndexValidationStatus
-
synchronizeIndexSchemas
Description copied from interface:IndexManagerSynchronizes schemas of all search indexes defined in application.- Specified by:
synchronizeIndexSchemasin interfaceIndexManager- Returns:
IndexSynchronizationStatusper eachIndexConfiguration
-
synchronizeIndexSchemas
public Map<IndexConfiguration,IndexSynchronizationStatus> synchronizeIndexSchemas(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManagerSynchronizes schemas of search indexes for provided collection ofIndexConfiguration.- Specified by:
synchronizeIndexSchemasin interfaceIndexManager- Parameters:
indexConfigurations- actual index configurations- Returns:
IndexSynchronizationStatusper eachIndexConfiguration
-
synchronizeIndexSchema
Description copied from interface:IndexManagerSynchronizes schema of search index for providedIndexConfiguration.It tries to update schema to the actual state according to
IndexSchemaManagementStrategydefined by 'jmix.search.indexSchemaManagementStrategy' application property.- Specified by:
synchronizeIndexSchemain 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)
-