Class OpenSearchEntitySearcher
java.lang.Object
io.jmix.searchopensearch.searching.impl.OpenSearchEntitySearcher
- All Implemented Interfaces:
EntitySearcher
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.opensearch.client.opensearch.OpenSearchClient
protected final IdSerialization
protected final IndexConfigurationManager
protected final InstanceNameProvider
protected final Metadata
protected final MetadataTools
protected final com.fasterxml.jackson.databind.ObjectMapper
protected final PolicyStore
protected final SearchProperties
protected final OpenSearchSearchStrategyProvider
protected final SearchUtils
protected final DataManager
protected final SecureOperations
-
Constructor Summary
ConstructorDescriptionOpenSearchEntitySearcher
(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 void
applyPostStrategyRequestSettings
(org.opensearch.client.opensearch.core.SearchRequest.Builder builder, SearchContext searchContext, int offset) protected void
configureHighlight
(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder) protected org.opensearch.client.opensearch.core.SearchRequest
createRequest
(SearchContext searchContext, List<String> targetIndexes, OpenSearchSearchStrategy searchStrategy, int offset) protected SearchResultEntry
createSearchResultEntry
(String entityId, String instanceName, String entityName, org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode> searchHit) protected void
fillSearchResult
(SearchResultImpl searchResultImpl, Map<MetaClass, List<org.opensearch.client.opensearch.core.search.Hit<com.fasterxml.jackson.databind.node.ObjectNode>>> hitsByEntityName) protected String
formatFieldName
(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 void
initRequest
(org.opensearch.client.opensearch.core.SearchRequest.Builder builder, List<String> targetIndexes) protected SearchResultImpl
initSearchResult
(SearchContext searchContext, OpenSearchSearchStrategy searchStrategy) protected boolean
isDisplayedField
(String fieldName) protected boolean
isResultFull
(SearchResultImpl searchResultImpl, SearchContext searchContext) objectNodeToMap
(com.fasterxml.jackson.databind.node.ObjectNode node) reloadIds
(MetaClass metaClass, Collection<Object> entityIds) protected OpenSearchSearchStrategy
resolveSearchStrategy
(String searchStrategyName) search
(SearchContext searchContext) Performs search in search indexes according to providedSearchContext
and defaultSearchStrategy
.search
(SearchContext searchContext, String searchStrategyName) Performs search in search indexes according to providedSearchContext
andSearchStrategy
.searchNextPage
(SearchResult previousSearchResult) Performs search of next page according toSearchContext
andSearchResult
contained in providedSearchStrategy
related 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:EntitySearcher
Performs search in search indexes according to providedSearchContext
and defaultSearchStrategy
.- Specified by:
search
in interfaceEntitySearcher
- Parameters:
searchContext
- runtime settings of specific search- Returns:
SearchResult
with found objects
-
search
Description copied from interface:EntitySearcher
Performs search in search indexes according to providedSearchContext
andSearchStrategy
.- Specified by:
search
in interfaceEntitySearcher
- Parameters:
searchContext
- runtime settings of specific searchsearchStrategyName
- the way incoming search text should be processed- Returns:
SearchResult
with found objects
-
searchNextPage
Description copied from interface:EntitySearcher
Performs search of next page according toSearchContext
andSearchResult
contained in providedSearchStrategy
related to previous page.- Specified by:
searchNextPage
in interfaceEntitySearcher
- Parameters:
previousSearchResult
-SearchResult
of previous page- Returns:
SearchResult
with 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
-