Class ElasticsearchEntitySearcher
java.lang.Object
io.jmix.searchelasticsearch.searching.impl.ElasticsearchEntitySearcher
- All Implemented Interfaces:
- EntitySearcher
Implementation for Elasticsearch
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final co.elastic.clients.elasticsearch.ElasticsearchClientprotected final IdSerializationprotected final IndexConfigurationManagerprotected final InstanceNameProviderprotected final Metadataprotected final MetadataToolsprotected final com.fasterxml.jackson.databind.ObjectMapperprotected final PolicyStoreprotected final SearchPropertiesprotected final ElasticsearchSearchStrategyProviderprotected final SearchUtilsprotected final DataManagerprotected final SecureOperations
- 
Constructor SummaryConstructorsConstructorDescriptionElasticsearchEntitySearcher(co.elastic.clients.elasticsearch.ElasticsearchClient client, IndexConfigurationManager indexConfigurationManager, Metadata metadata, MetadataTools metadataTools, DataManager secureDataManager, InstanceNameProvider instanceNameProvider, SearchProperties searchProperties, IdSerialization idSerialization, SecureOperations secureOperations, PolicyStore policyStore, ElasticsearchSearchStrategyProvider searchStrategyManager, SearchUtils searchUtils) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidapplyPostStrategyRequestSettings(co.elastic.clients.elasticsearch.core.SearchRequest.Builder builder, SearchContext searchContext, int offset) protected voidconfigureHighlight(co.elastic.clients.elasticsearch.core.SearchRequest.Builder requestBuilder) protected co.elastic.clients.elasticsearch.core.SearchRequestcreateRequest(SearchContext searchContext, List<String> targetIndexes, ElasticsearchSearchStrategy searchStrategy, int offset) protected SearchResultEntrycreateSearchResultEntry(String entityId, String instanceName, String entityName, co.elastic.clients.elasticsearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode> searchHit) protected voidfillSearchResult(SearchResultImpl searchResultImpl, Map<MetaClass, List<co.elastic.clients.elasticsearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> hitsByEntityName) protected StringformatFieldName(String fieldName) protected Map<MetaClass,List<co.elastic.clients.elasticsearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> groupHitsByEntity(co.elastic.clients.elasticsearch.core.search.HitsMetadata<com.fasterxml.jackson.databind.node.ObjectNode> hits) protected voidinitRequest(co.elastic.clients.elasticsearch.core.SearchRequest.Builder builder, List<String> targetIndexes) protected SearchResultImplinitSearchResult(SearchContext searchContext, ElasticsearchSearchStrategy searchStrategy) protected booleanisDisplayedField(String fieldName) protected booleanisResultFull(SearchResultImpl searchResultImpl, SearchContext searchContext) objectNodeToMap(com.fasterxml.jackson.databind.node.ObjectNode node) reloadIds(MetaClass metaClass, Collection<Object> entityIds) protected ElasticsearchSearchStrategyresolveSearchStrategy(String searchStrategyName) resolveTargetIndexes(SearchContext searchContext) search(SearchContext searchContext) Performs search in search indexes according to providedSearchContextand defaultSearchStrategy.search(SearchContext searchContext, String searchStrategyName) Performs search in search indexes according to providedSearchContextandSearchStrategy.searchNextPage(SearchResult previousSearchResult) Performs search of next page according toSearchContextandSearchResultcontained in providedSearchStrategyrelated to previous page.
- 
Field Details- 
GENERIC_MAP_TYPE_REF
- 
clientprotected final co.elastic.clients.elasticsearch.ElasticsearchClient client
- 
indexConfigurationManager
- 
metadata
- 
metadataTools
- 
secureDataManager
- 
instanceNameProvider
- 
searchProperties
- 
idSerialization
- 
secureOperations
- 
policyStore
- 
searchStrategyManager
- 
searchUtils
- 
objectMapperprotected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
 
- 
- 
Constructor Details- 
ElasticsearchEntitySearcherpublic ElasticsearchEntitySearcher(co.elastic.clients.elasticsearch.ElasticsearchClient client, IndexConfigurationManager indexConfigurationManager, Metadata metadata, MetadataTools metadataTools, DataManager secureDataManager, InstanceNameProvider instanceNameProvider, SearchProperties searchProperties, IdSerialization idSerialization, SecureOperations secureOperations, PolicyStore policyStore, ElasticsearchSearchStrategyProvider searchStrategyManager, SearchUtils searchUtils) 
 
- 
- 
Method Details- 
searchDescription copied from interface:EntitySearcherPerforms search in search indexes according to providedSearchContextand defaultSearchStrategy.- Specified by:
- searchin interface- EntitySearcher
- Parameters:
- searchContext- runtime settings of specific search
- Returns:
- SearchResultwith found objects
 
- 
searchDescription copied from interface:EntitySearcherPerforms search in search indexes according to providedSearchContextandSearchStrategy.- Specified by:
- searchin interface- EntitySearcher
- Parameters:
- searchContext- runtime settings of specific search
- searchStrategyName- the way incoming search text should be processed
- Returns:
- SearchResultwith found objects
 
- 
searchNextPageDescription copied from interface:EntitySearcherPerforms search of next page according toSearchContextandSearchResultcontained in providedSearchStrategyrelated to previous page.- Specified by:
- searchNextPagein interface- EntitySearcher
- Parameters:
- previousSearchResult-- SearchResultof previous page
- Returns:
- SearchResultwith found objects
 
- 
initSearchResultprotected SearchResultImpl initSearchResult(SearchContext searchContext, ElasticsearchSearchStrategy searchStrategy) 
- 
resolveTargetIndexes
- 
resolveSearchStrategy
- 
createRequestprotected co.elastic.clients.elasticsearch.core.SearchRequest createRequest(SearchContext searchContext, List<String> targetIndexes, ElasticsearchSearchStrategy searchStrategy, int offset) 
- 
initRequest
- 
applyPostStrategyRequestSettingsprotected void applyPostStrategyRequestSettings(co.elastic.clients.elasticsearch.core.SearchRequest.Builder builder, SearchContext searchContext, int offset) 
- 
configureHighlightprotected void configureHighlight(co.elastic.clients.elasticsearch.core.SearchRequest.Builder requestBuilder) 
- 
groupHitsByEntity
- 
fillSearchResultprotected void fillSearchResult(SearchResultImpl searchResultImpl, Map<MetaClass, List<co.elastic.clients.elasticsearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> hitsByEntityName) 
- 
isResultFull
- 
objectNodeToMap
- 
createSearchResultEntryprotected SearchResultEntry createSearchResultEntry(String entityId, String instanceName, String entityName, co.elastic.clients.elasticsearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode> searchHit) 
- 
isDisplayedField
- 
formatFieldName
- 
reloadIds
 
-