Class OpenSearchEntitySearcher
java.lang.Object
io.jmix.searchopensearch.searching.impl.OpenSearchEntitySearcher
- All Implemented Interfaces:
EntitySearcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.opensearch.client.opensearch.OpenSearchClientprotected final IdSerializationprotected final IndexConfigurationManagerprotected final InstanceNameProviderprotected final Metadataprotected final MetadataToolsprotected final com.fasterxml.jackson.databind.ObjectMapperprotected final PolicyStoreprotected final SearchPropertiesprotected final OpenSearchSearchStrategyProviderprotected final SearchUtilsprotected final DataManagerprotected final SecureOperations -
Constructor Summary
ConstructorsConstructorDescriptionOpenSearchEntitySearcher(org.opensearch.client.opensearch.OpenSearchClient client, IndexConfigurationManager indexConfigurationManager, Metadata metadata, MetadataTools metadataTools, DataManager secureDataManager, InstanceNameProvider instanceNameProvider, SearchProperties searchProperties, IdSerialization idSerialization, SecureOperations secureOperations, PolicyStore policyStore, OpenSearchSearchStrategyProvider searchStrategyManager, SearchUtils searchUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyPostStrategyRequestSettings(org.opensearch.client.opensearch.core.SearchRequest.Builder builder, SearchContext searchContext, int offset) protected voidconfigureHighlight(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder) protected org.opensearch.client.opensearch.core.SearchRequestcreateRequest(SearchContext searchContext, List<String> targetIndexes, OpenSearchSearchStrategy searchStrategy, int offset) protected SearchResultEntrycreateSearchResultEntry(String entityId, String instanceName, String entityName, org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode> searchHit) protected voidfillSearchResult(SearchResultImpl searchResultImpl, Map<MetaClass, List<org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> hitsByEntityName) protected StringformatFieldName(String fieldName) protected Map<MetaClass,List<org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> groupHitsByEntity(org.opensearch.client.opensearch.core.search.HitsMetadata<com.fasterxml.jackson.databind.node.ObjectNode> hits) protected voidinitRequest(org.opensearch.client.opensearch.core.SearchRequest.Builder builder, List<String> targetIndexes) protected SearchResultImplinitSearchResult(SearchContext searchContext, OpenSearchSearchStrategy 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 OpenSearchSearchStrategyresolveSearchStrategy(String searchStrategyName) 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
-
client
protected final org.opensearch.client.opensearch.OpenSearchClient client -
indexConfigurationManager
-
metadata
-
metadataTools
-
secureDataManager
-
instanceNameProvider
-
searchProperties
-
idSerialization
-
secureOperations
-
policyStore
-
searchStrategyManager
-
searchUtils
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
OpenSearchEntitySearcher
public OpenSearchEntitySearcher(org.opensearch.client.opensearch.OpenSearchClient client, IndexConfigurationManager indexConfigurationManager, Metadata metadata, MetadataTools metadataTools, DataManager secureDataManager, InstanceNameProvider instanceNameProvider, SearchProperties searchProperties, IdSerialization idSerialization, SecureOperations secureOperations, PolicyStore policyStore, OpenSearchSearchStrategyProvider searchStrategyManager, SearchUtils searchUtils)
-
-
Method Details
-
search
Description copied from interface:EntitySearcherPerforms search in search indexes according to providedSearchContextand defaultSearchStrategy.- Specified by:
searchin interfaceEntitySearcher- Parameters:
searchContext- runtime settings of specific search- Returns:
SearchResultwith found objects
-
search
Description copied from interface:EntitySearcherPerforms search in search indexes according to providedSearchContextandSearchStrategy.- Specified by:
searchin interfaceEntitySearcher- Parameters:
searchContext- runtime settings of specific searchsearchStrategyName- the way incoming search text should be processed- Returns:
SearchResultwith found objects
-
searchNextPage
Description copied from interface:EntitySearcherPerforms search of next page according toSearchContextandSearchResultcontained in providedSearchStrategyrelated to previous page.- Specified by:
searchNextPagein interfaceEntitySearcher- Parameters:
previousSearchResult-SearchResultof previous page- Returns:
SearchResultwith found objects
-
initSearchResult
protected SearchResultImpl initSearchResult(SearchContext searchContext, OpenSearchSearchStrategy searchStrategy) -
resolveSearchStrategy
-
createRequest
protected org.opensearch.client.opensearch.core.SearchRequest createRequest(SearchContext searchContext, List<String> targetIndexes, OpenSearchSearchStrategy searchStrategy, int offset) -
initRequest
-
applyPostStrategyRequestSettings
protected void applyPostStrategyRequestSettings(org.opensearch.client.opensearch.core.SearchRequest.Builder builder, SearchContext searchContext, int offset) -
configureHighlight
protected void configureHighlight(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder) -
groupHitsByEntity
-
fillSearchResult
protected void fillSearchResult(SearchResultImpl searchResultImpl, Map<MetaClass, List<org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> hitsByEntityName) -
isResultFull
-
objectNodeToMap
-
createSearchResultEntry
protected SearchResultEntry createSearchResultEntry(String entityId, String instanceName, String entityName, org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode> searchHit) -
isDisplayedField
-
formatFieldName
-
reloadIds
-