Package de.cxp.ocs.elasticsearch
Class Searcher
java.lang.Object
de.cxp.ocs.elasticsearch.Searcher
-
Constructor Summary
ConstructorsConstructorDescriptionSearcher
(org.elasticsearch.client.RestHighLevelClient restClient, SearchContext searchContext, io.micrometer.core.instrument.MeterRegistry registry, SearchPlugins plugins) -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.action.search.SearchResponse
executeSearchRequest
(org.elasticsearch.search.builder.SearchSourceBuilder searchSourceBuilder) find
(InternalSearchParams parameters) find
(InternalSearchParams parameters, Map<String, Object> searchMetaData) Compute result based on the given parameters.queryStringFind
(InternalSearchParams parameters, Map<String, Float> fieldWeights)
-
Constructor Details
-
Searcher
public Searcher(org.elasticsearch.client.RestHighLevelClient restClient, SearchContext searchContext, io.micrometer.core.instrument.MeterRegistry registry, SearchPlugins plugins)
-
-
Method Details
-
find
- Throws:
IOException
-
find
public SearchResult find(InternalSearchParams parameters, Map<String, Object> searchMetaData) throws IOExceptionCompute result based on the given parameters. The searchMetaData are attached to the search-result, so by that you can pass additional information into the result or use it for debugging in case of an error.- Parameters:
parameters
- the parsed and validated parameterssearchMetaData
- in case an exception occurs, this meta data might already be partially filled with data which might be useful for debuggingqueryContext.variantSortings- Returns:
- a search result according to the given parameters
- Throws:
IOException
- in case of connection errors
-
queryStringFind
public SearchResult queryStringFind(InternalSearchParams parameters, Map<String, Float> fieldWeights) throws IOException- Throws:
IOException
-
executeSearchRequest
public org.elasticsearch.action.search.SearchResponse executeSearchRequest(org.elasticsearch.search.builder.SearchSourceBuilder searchSourceBuilder) throws IOException - Throws:
IOException
-