Class AbstractOpenSearchWrapper
java.lang.Object
org.craftercms.search.opensearch.impl.AbstractOpenSearchWrapper
- All Implemented Interfaces:
OpenSearchWrapper
Base implementation of
OpenSearchWrapper- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.action.search.SearchResponsePerforms a search operationorg.opensearch.action.search.SearchResponsesearch(Map<String, Object> request, Map<String, Object> parameters, org.opensearch.client.RequestOptions options) Performs a search operationorg.opensearch.action.search.SearchResponsesearch(org.opensearch.action.search.SearchRequest request, org.opensearch.client.RequestOptions options) Performs a search operationvoidsetFilterQueries(String[] filterQueries) protected voidupdateFilters(org.opensearch.action.search.SearchRequest request) Updates the filter queries for the given requestprotected abstract voidupdateIndex(org.opensearch.action.search.SearchRequest request) Updates the value of the index for the given request
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
PARAM_NAME_INDEX
- See Also:
-
PARAM_NAME_SEARCH_TYPE
- See Also:
-
client
protected final org.opensearch.client.RestHighLevelClient clientThe OpenSearch client -
filterQueries
The filter queries to apply to all searches
-
-
Constructor Details
-
AbstractOpenSearchWrapper
public AbstractOpenSearchWrapper(org.opensearch.client.RestHighLevelClient client)
-
-
Method Details
-
setFilterQueries
-
updateIndex
protected abstract void updateIndex(org.opensearch.action.search.SearchRequest request) Updates the value of the index for the given request- Parameters:
request- the request to update
-
updateFilters
protected void updateFilters(org.opensearch.action.search.SearchRequest request) Updates the filter queries for the given request- Parameters:
request- the request to update
-
search
public org.opensearch.action.search.SearchResponse search(org.opensearch.action.search.SearchRequest request, org.opensearch.client.RequestOptions options) Performs a search operation- Specified by:
searchin interfaceOpenSearchWrapper- Parameters:
request- the search requestoptions- the request options- Returns:
- the search response
-
search
public org.opensearch.action.search.SearchResponse search(Map<String, Object> request, Map<String, Object> parameters, org.opensearch.client.RequestOptions options) Performs a search operation- Specified by:
searchin interfaceOpenSearchWrapper- Parameters:
request- the search requestparameters- the parameters for the searchoptions- the request options- Returns:
- the search response
-
search
public org.opensearch.action.search.SearchResponse search(String request, Map<String, Object> parameters, org.opensearch.client.RequestOptions options) Performs a search operation- Specified by:
searchin interfaceOpenSearchWrapper- Parameters:
request- the search requestparameters- the parameters for the searchoptions- the request options- Returns:
- the search response
-