Package io.jmix.search.searching.impl
Class EntitySearcherImpl
java.lang.Object
io.jmix.search.searching.impl.EntitySearcherImpl
- All Implemented Interfaces:
EntitySearcher
@Component("search_EntitySearcher")
public class EntitySearcherImpl
extends Object
implements EntitySearcher
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.elasticsearch.client.RestHighLevelClient
protected IdSerialization
protected IndexConfigurationManager
protected InstanceNameProvider
protected Metadata
protected MetadataTools
protected PolicyStore
protected SearchProperties
protected SearchStrategyManager
protected DataManager
protected SecureOperations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureHighlight
(org.elasticsearch.action.search.SearchRequest searchRequest) protected org.elasticsearch.action.search.SearchRequest
createBaseSearchRequest
(List<String> targetIndexes) protected org.elasticsearch.action.search.SearchRequest
createSearchRequest
(List<String> targetIndexes, SearchContext searchContext, SearchStrategy searchStrategy) protected SearchResultEntry
createSearchResultEntry
(String entityId, String instanceName, String entityName, org.elasticsearch.search.SearchHit searchHit) protected void
fillSearchResult
(SearchResultImpl searchResultImpl, Map<MetaClass, List<org.elasticsearch.search.SearchHit>> hitsByEntityName) protected String
formatFieldName
(String fieldName) groupSearchHitsByEntity
(org.elasticsearch.search.SearchHits searchHits) protected SearchResultImpl
initSearchResult
(SearchContext searchContext, SearchStrategy searchStrategy) protected boolean
isDisplayedField
(String fieldName) protected boolean
isResultFull
(SearchResultImpl searchResultImpl, SearchContext searchContext) protected void
postStrategyConfiguration
(org.elasticsearch.action.search.SearchRequest searchRequest, SearchContext searchContext) reloadIds
(MetaClass metaClass, Collection<Object> entityIds) resolveTargetIndexes
(SearchContext searchContext) search
(SearchContext searchContext) Performs search in search indexes according to providedSearchContext
and defaultSearchStrategy
.search
(SearchContext searchContext, SearchStrategy searchStrategy) 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.protected void
updateRequestOffset
(org.elasticsearch.action.search.SearchRequest searchRequest, SearchResultImpl searchResult)
-
Field Details
-
esClient
@Autowired protected org.elasticsearch.client.RestHighLevelClient esClient -
metadata
-
metadataTools
-
secureDataManager
-
instanceNameProvider
-
searchProperties
-
idSerialization
-
secureOperations
-
indexConfigurationManager
-
policyStore
-
searchStrategyManager
-
-
Constructor Details
-
EntitySearcherImpl
public EntitySearcherImpl()
-
-
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 searchsearchStrategy
- 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, SearchStrategy searchStrategy) -
createSearchRequest
protected org.elasticsearch.action.search.SearchRequest createSearchRequest(List<String> targetIndexes, SearchContext searchContext, SearchStrategy searchStrategy) -
createBaseSearchRequest
-
postStrategyConfiguration
protected void postStrategyConfiguration(org.elasticsearch.action.search.SearchRequest searchRequest, SearchContext searchContext) -
resolveTargetIndexes
-
configureHighlight
protected void configureHighlight(org.elasticsearch.action.search.SearchRequest searchRequest) -
updateRequestOffset
protected void updateRequestOffset(org.elasticsearch.action.search.SearchRequest searchRequest, SearchResultImpl searchResult) -
isResultFull
-
groupSearchHitsByEntity
-
fillSearchResult
protected void fillSearchResult(SearchResultImpl searchResultImpl, Map<MetaClass, List<org.elasticsearch.search.SearchHit>> hitsByEntityName) -
createSearchResultEntry
protected SearchResultEntry createSearchResultEntry(String entityId, String instanceName, String entityName, org.elasticsearch.search.SearchHit searchHit) -
isDisplayedField
-
reloadIds
-
formatFieldName
-