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
Modifier and TypeFieldDescriptionprotected UnconstrainedDataManager
protected org.elasticsearch.client.RestHighLevelClient
protected FetchPlans
protected IdSerialization
protected IndexConfigurationManager
protected IndexStateRegistry
protected Metadata
protected MetadataTools
protected com.fasterxml.jackson.databind.ObjectMapper
protected SearchProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDeleteActionToBulkRequest
(org.elasticsearch.action.bulk.BulkRequest request, IndexConfiguration indexConfiguration, String indexId) protected void
addFieldValueToEntityIndexContent
(com.fasterxml.jackson.databind.node.ObjectNode entityIndexContent, MappingFieldDescriptor field, Object entity) protected void
addIndexActionToBulkRequest
(org.elasticsearch.action.bulk.BulkRequest request, IndexConfiguration indexConfiguration, Object instance) protected FetchPlan
createFetchPlan
(IndexConfiguration indexConfiguration) protected org.elasticsearch.action.bulk.BulkResponse
protected com.fasterxml.jackson.databind.node.ObjectNode
createObjectNodeForField
(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 IndexResult
deleteByGroupedIndexIds
(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.BulkResponse
executeBulkRequest
(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 IndexResult
indexGroupedInstances
(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:EntityIndexer
Stores provided entity instance to index.- Specified by:
index
in interfaceEntityIndexer
- Parameters:
entityInstance
- instance- Returns:
IndexResult
-
indexCollection
Description copied from interface:EntityIndexer
Stores provided entity instances to index.- Specified by:
indexCollection
in interfaceEntityIndexer
- Parameters:
entityInstances
- instances- Returns:
IndexResult
-
indexByEntityId
Description copied from interface:EntityIndexer
Stores entity instance to index by provided ID.- Specified by:
indexByEntityId
in interfaceEntityIndexer
- Parameters:
entityId
- ID of entity instance- Returns:
IndexResult
-
indexCollectionByEntityIds
Description copied from interface:EntityIndexer
Stores entity instances to index by provided IDs.- Specified by:
indexCollectionByEntityIds
in interfaceEntityIndexer
- Parameters:
entityIds
- IDs of entity instances- Returns:
IndexResult
-
delete
Description copied from interface:EntityIndexer
Deletes provided entity instance from index.- Specified by:
delete
in interfaceEntityIndexer
- Parameters:
entityInstance
- instance- Returns:
IndexResult
-
deleteCollection
Description copied from interface:EntityIndexer
Deletes provided entity instances from index.- Specified by:
deleteCollection
in interfaceEntityIndexer
- Parameters:
entityInstances
- instances- Returns:
IndexResult
-
deleteByEntityId
Description copied from interface:EntityIndexer
Deletes entity instance from index by provided ID.- Specified by:
deleteByEntityId
in interfaceEntityIndexer
- Parameters:
entityId
- ID of entity instance- Returns:
IndexResult
-
deleteCollectionByEntityIds
Description copied from interface:EntityIndexer
Deletes entity instances from index by provided IDs.- Specified by:
deleteCollectionByEntityIds
in 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()
-