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 SummaryNested ClassesModifier and TypeClassDescriptionprotected static final record
- 
Field SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionBaseEntityIndexer(UnconstrainedDataManager dataManager, FetchPlans fetchPlans, IndexConfigurationManager indexConfigurationManager, Metadata metadata, IdSerialization idSerialization, IndexStateRegistry indexStateRegistry, MetadataTools metadataTools, SearchProperties searchProperties) 
- 
Method SummaryModifier 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
- 
objectMapperprotected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
 
- 
- 
Constructor Details- 
BaseEntityIndexerpublic BaseEntityIndexer(UnconstrainedDataManager dataManager, FetchPlans fetchPlans, IndexConfigurationManager indexConfigurationManager, Metadata metadata, IdSerialization idSerialization, IndexStateRegistry indexStateRegistry, MetadataTools metadataTools, SearchProperties searchProperties) 
 
- 
- 
Method Details- 
indexDescription copied from interface:EntityIndexerStores provided entity instance to index.- Specified by:
- indexin interface- EntityIndexer
- Parameters:
- entityInstance- instance
- Returns:
- IndexResult
 
- 
indexCollectionDescription copied from interface:EntityIndexerStores provided entity instances to index.- Specified by:
- indexCollectionin interface- EntityIndexer
- Parameters:
- entityInstances- instances
- Returns:
- IndexResult
 
- 
indexByEntityIdDescription copied from interface:EntityIndexerStores entity instance to index by provided ID.- Specified by:
- indexByEntityIdin interface- EntityIndexer
- Parameters:
- entityId- ID of entity instance
- Returns:
- IndexResult
 
- 
indexCollectionByEntityIdsDescription copied from interface:EntityIndexerStores entity instances to index by provided IDs.- Specified by:
- indexCollectionByEntityIdsin interface- EntityIndexer
- Parameters:
- entityIds- IDs of entity instances
- Returns:
- IndexResult
 
- 
deleteDescription copied from interface:EntityIndexerDeletes provided entity instance from index.- Specified by:
- deletein interface- EntityIndexer
- Parameters:
- entityInstance- instance
- Returns:
- IndexResult
 
- 
deleteCollectionDescription copied from interface:EntityIndexerDeletes provided entity instances from index.- Specified by:
- deleteCollectionin interface- EntityIndexer
- Parameters:
- entityInstances- instances
- Returns:
- IndexResult
 
- 
deleteByEntityIdDescription copied from interface:EntityIndexerDeletes entity instance from index by provided ID.- Specified by:
- deleteByEntityIdin interface- EntityIndexer
- Parameters:
- entityId- ID of entity instance
- Returns:
- IndexResult
 
- 
deleteCollectionByEntityIdsDescription copied from interface:EntityIndexerDeletes entity instances from index by provided IDs.- Specified by:
- deleteCollectionByEntityIdsin interface- EntityIndexer
- Parameters:
- entityIds- IDs of entity instances
- Returns:
- IndexResult
 
- 
indexDocuments
- 
deleteByGroupedDocIdsprotected abstract IndexResult deleteByGroupedDocIds(Map<IndexConfiguration, Collection<String>> groupedDocIds) 
- 
indexGroupedInstancesprotected IndexResult indexGroupedInstances(Map<IndexConfiguration, Collection<Object>> groupedInstances) 
- 
deleteByGroupedIndexIdsInternalprotected IndexResult deleteByGroupedIndexIdsInternal(Map<IndexConfiguration, Collection<String>> groupedIndexIds) 
- 
prepareInstancesForIndexingprotected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexing(Collection<Object> instances) 
- 
prepareInstancesForIndexingByIdsprotected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexingByIds(Collection<Id<?>> entityIds) 
- 
prepareIndexIdsByEntityInstancesprotected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityInstances(Collection<Object> instances) 
- 
prepareIndexIdsByEntityIdsprotected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityIds(Collection<Id<?>> entityIds) 
- 
reloadEntityInstancesprotected Map<IndexConfiguration,Collection<Object>> reloadEntityInstances(Map<MetaClass, List<Object>> idsGroupedByMetaClass) 
- 
createFetchPlan
- 
generateIndexDocumentprotected BaseEntityIndexer.IndexDocumentData generateIndexDocument(IndexConfiguration indexConfiguration, Object instance) 
- 
addFieldValueToEntityIndexContentprotected void addFieldValueToEntityIndexContent(com.fasterxml.jackson.databind.node.ObjectNode entityIndexContent, MappingFieldDescriptor field, Object entity) 
- 
createObjectNodeForFieldprotected com.fasterxml.jackson.databind.node.ObjectNode createObjectNodeForField(String key, com.fasterxml.jackson.databind.JsonNode value) 
- 
mergeprotected void merge(com.fasterxml.jackson.databind.JsonNode toBeMerged, com.fasterxml.jackson.databind.JsonNode mergedInTo) 
- 
updateArray
- 
updateObject
 
-