Package io.jmix.search.index.impl
Class EntityIndexerImpl
java.lang.Object
io.jmix.search.index.impl.EntityIndexerImpl
- All Implemented Interfaces:
EntityIndexer
@Component("search_EntityIndexer")
public class EntityIndexerImpl
extends Object
implements EntityIndexer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected UnconstrainedDataManagerprotected org.elasticsearch.client.RestHighLevelClientprotected FetchPlansprotected IdSerializationprotected IndexConfigurationManagerprotected IndexStateRegistryprotected Metadataprotected MetadataToolsprotected com.fasterxml.jackson.databind.ObjectMapperprotected SearchProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDeleteActionToBulkRequest(org.elasticsearch.action.bulk.BulkRequest request, IndexConfiguration indexConfiguration, String indexId) protected voidaddFieldValueToEntityIndexContent(com.fasterxml.jackson.databind.node.ObjectNode entityIndexContent, MappingFieldDescriptor field, Object entity) protected voidaddIndexActionToBulkRequest(org.elasticsearch.action.bulk.BulkRequest request, IndexConfiguration indexConfiguration, Object instance) protected FetchPlancreateFetchPlan(IndexConfiguration indexConfiguration) protected org.elasticsearch.action.bulk.BulkResponseprotected 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 IndexResultdeleteByGroupedIndexIds(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 org.elasticsearch.action.bulk.BulkResponseexecuteBulkRequest(org.elasticsearch.action.bulk.BulkRequest request) 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 IndexResultindexGroupedInstances(Map<IndexConfiguration, Collection<Object>> groupedInstancesForIndexing) 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)
-
Field Details
-
dataManager
-
fetchPlans
-
esClient
@Autowired protected org.elasticsearch.client.RestHighLevelClient esClient -
indexConfigurationManager
-
metadata
-
idSerialization
-
indexStateRegistry
-
metadataTools
-
searchProperties
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
EntityIndexerImpl
public EntityIndexerImpl()
-
-
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
-
indexGroupedInstances
protected IndexResult indexGroupedInstances(Map<IndexConfiguration, Collection<Object>> groupedInstancesForIndexing) -
executeBulkRequest
protected org.elasticsearch.action.bulk.BulkResponse executeBulkRequest(org.elasticsearch.action.bulk.BulkRequest request) -
prepareInstancesForIndexing
protected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexing(Collection<Object> instances) -
prepareInstancesForIndexingByIds
protected Map<IndexConfiguration,Collection<Object>> prepareInstancesForIndexingByIds(Collection<Id<?>> entityIds) -
reloadEntityInstances
protected Map<IndexConfiguration,Collection<Object>> reloadEntityInstances(Map<MetaClass, List<Object>> idsGroupedByMetaClass) -
createFetchPlan
-
addIndexActionToBulkRequest
protected void addIndexActionToBulkRequest(org.elasticsearch.action.bulk.BulkRequest request, IndexConfiguration indexConfiguration, Object instance) -
prepareIndexIdsByEntityInstances
protected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityInstances(Collection<Object> instances) -
prepareIndexIdsByEntityIds
protected Map<IndexConfiguration,Collection<String>> prepareIndexIdsByEntityIds(Collection<Id<?>> entityIds) -
deleteByGroupedIndexIds
protected IndexResult deleteByGroupedIndexIds(Map<IndexConfiguration, Collection<String>> groupedIndexIds) -
addDeleteActionToBulkRequest
protected void addDeleteActionToBulkRequest(org.elasticsearch.action.bulk.BulkRequest request, IndexConfiguration indexConfiguration, String indexId) -
createObjectNodeForField
protected com.fasterxml.jackson.databind.node.ObjectNode createObjectNodeForField(String key, com.fasterxml.jackson.databind.JsonNode value) -
addFieldValueToEntityIndexContent
protected void addFieldValueToEntityIndexContent(com.fasterxml.jackson.databind.node.ObjectNode entityIndexContent, MappingFieldDescriptor field, Object entity) -
createNoopBulkResponse
protected org.elasticsearch.action.bulk.BulkResponse createNoopBulkResponse()
-