Package io.jmix.search.index.impl
Class BaseEntityIndexer
java.lang.Object
io.jmix.search.index.impl.BaseEntityIndexer
- All Implemented Interfaces:
EntityIndexer
- Direct Known Subclasses:
ElasticsearchEntityIndexer,OpenSearchEntityIndexer
Provides non-platform-specific functionality.
Interaction with indexes is performed in platform-specific implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final UnconstrainedDataManagerprotected final FetchPlansprotected final IdSerializationprotected final IndexConfigurationManagerprotected final IndexStateRegistryprotected final Metadataprotected final MetadataToolsprotected final com.fasterxml.jackson.databind.ObjectMapperprotected final SearchProperties -
Constructor Summary
ConstructorsConstructorDescriptionBaseEntityIndexer(UnconstrainedDataManager dataManager, FetchPlans fetchPlans, IndexConfigurationManager indexConfigurationManager, Metadata metadata, IdSerialization idSerialization, IndexStateRegistry indexStateRegistry, MetadataTools metadataTools, SearchProperties searchProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFieldValueToEntityIndexContent(com.fasterxml.jackson.databind.node.ObjectNode entityIndexContent, MappingFieldDescriptor field, Object entity) protected FetchPlancreateFetchPlan(IndexConfiguration indexConfiguration) protected com.fasterxml.jackson.databind.node.ObjectNodecreateObjectNodeForField(String key, com.fasterxml.jackson.databind.JsonNode value) Deletes provided entity instance from index.deleteByEntityId(Id<?> entityId) Deletes entity instance from index by provided ID.protected abstract IndexResultdeleteByGroupedDocIds(Map<IndexConfiguration, Collection<String>> groupedDocIds) protected IndexResultdeleteByGroupedIndexIdsInternal(Map<IndexConfiguration, Collection<String>> groupedIndexIds) deleteCollection(Collection<Object> entityInstances) Deletes provided entity instances from index.deleteCollectionByEntityIds(Collection<Id<?>> entityIds) Deletes entity instances from index by provided IDs.protected BaseEntityIndexer.IndexDocumentDatagenerateIndexDocument(IndexConfiguration indexConfiguration, Object instance) Stores provided entity instance to index.indexByEntityId(Id<?> entityId) Stores entity instance to index by provided ID.indexCollection(Collection<Object> entityInstances) Stores provided entity instances to index.indexCollectionByEntityIds(Collection<Id<?>> entityIds) Stores entity instances to index by provided IDs.protected abstract IndexResultindexDocuments(List<BaseEntityIndexer.IndexDocumentData> documents) protected IndexResultindexGroupedInstances(Map<IndexConfiguration, Collection<Object>> groupedInstances) protected voidmerge(com.fasterxml.jackson.databind.JsonNode toBeMerged, com.fasterxml.jackson.databind.JsonNode mergedInTo) protected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityIds(Collection<Id<?>> entityIds) protected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityInstances(Collection<Object> instances) protected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexing(Collection<Object> instances) protected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexingByIds(Collection<Id<?>> entityIds) protected Map<IndexConfiguration,Collection<Object>> reloadEntityInstances(Map<MetaClass, List<Object>> idsGroupedByMetaClass) protected voidupdateArray(com.fasterxml.jackson.databind.JsonNode valueToBePlaced, Map.Entry<String, com.fasterxml.jackson.databind.JsonNode> toBeMerged) protected voidupdateObject(com.fasterxml.jackson.databind.JsonNode mergeInTo, com.fasterxml.jackson.databind.node.ValueNode valueToBePlaced, Map.Entry<String, com.fasterxml.jackson.databind.JsonNode> toBeMerged)
-
Field Details
-
dataManager
-
fetchPlans
-
indexConfigurationManager
-
metadata
-
idSerialization
-
indexStateRegistry
-
metadataTools
-
searchProperties
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
BaseEntityIndexer
public BaseEntityIndexer(UnconstrainedDataManager dataManager, FetchPlans fetchPlans, IndexConfigurationManager indexConfigurationManager, Metadata metadata, IdSerialization idSerialization, IndexStateRegistry indexStateRegistry, MetadataTools metadataTools, SearchProperties searchProperties)
-
-
Method Details
-
index
Description copied from interface:EntityIndexerStores provided entity instance to index.- Specified by:
indexin interfaceEntityIndexer- Parameters:
entityInstance- instance- Returns:
IndexResult
-
indexCollection
Description copied from interface:EntityIndexerStores provided entity instances to index.- Specified by:
indexCollectionin interfaceEntityIndexer- Parameters:
entityInstances- instances- Returns:
IndexResult
-
indexByEntityId
Description copied from interface:EntityIndexerStores entity instance to index by provided ID.- Specified by:
indexByEntityIdin interfaceEntityIndexer- Parameters:
entityId- ID of entity instance- Returns:
IndexResult
-
indexCollectionByEntityIds
Description copied from interface:EntityIndexerStores entity instances to index by provided IDs.- Specified by:
indexCollectionByEntityIdsin interfaceEntityIndexer- Parameters:
entityIds- IDs of entity instances- Returns:
IndexResult
-
delete
Description copied from interface:EntityIndexerDeletes provided entity instance from index.- Specified by:
deletein interfaceEntityIndexer- Parameters:
entityInstance- instance- Returns:
IndexResult
-
deleteCollection
Description copied from interface:EntityIndexerDeletes provided entity instances from index.- Specified by:
deleteCollectionin interfaceEntityIndexer- Parameters:
entityInstances- instances- Returns:
IndexResult
-
deleteByEntityId
Description copied from interface:EntityIndexerDeletes entity instance from index by provided ID.- Specified by:
deleteByEntityIdin interfaceEntityIndexer- Parameters:
entityId- ID of entity instance- Returns:
IndexResult
-
deleteCollectionByEntityIds
Description copied from interface:EntityIndexerDeletes entity instances from index by provided IDs.- Specified by:
deleteCollectionByEntityIdsin interfaceEntityIndexer- Parameters:
entityIds- IDs of entity instances- Returns:
IndexResult
-
indexDocuments
-
deleteByGroupedDocIds
protected abstract IndexResult deleteByGroupedDocIds(Map<IndexConfiguration, Collection<String>> groupedDocIds) -
indexGroupedInstances
protected IndexResult indexGroupedInstances(Map<IndexConfiguration, Collection<Object>> groupedInstances) -
deleteByGroupedIndexIdsInternal
protected IndexResult deleteByGroupedIndexIdsInternal(Map<IndexConfiguration, Collection<String>> groupedIndexIds) -
prepareInstancesForIndexing
protected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexing(Collection<Object> instances) -
prepareInstancesForIndexingByIds
protected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexingByIds(Collection<Id<?>> entityIds) -
prepareIndexIdsByEntityInstances
protected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityInstances(Collection<Object> instances) -
prepareIndexIdsByEntityIds
protected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityIds(Collection<Id<?>> entityIds) -
reloadEntityInstances
protected Map<IndexConfiguration,Collection<Object>> reloadEntityInstances(Map<MetaClass, List<Object>> idsGroupedByMetaClass) -
createFetchPlan
-
generateIndexDocument
protected BaseEntityIndexer.IndexDocumentData generateIndexDocument(IndexConfiguration indexConfiguration, Object instance) -
addFieldValueToEntityIndexContent
protected void addFieldValueToEntityIndexContent(com.fasterxml.jackson.databind.node.ObjectNode entityIndexContent, MappingFieldDescriptor field, Object entity) -
createObjectNodeForField
protected com.fasterxml.jackson.databind.node.ObjectNode createObjectNodeForField(String key, com.fasterxml.jackson.databind.JsonNode value) -
merge
protected void merge(com.fasterxml.jackson.databind.JsonNode toBeMerged, com.fasterxml.jackson.databind.JsonNode mergedInTo) -
updateArray
-
updateObject
-