Class PhraseOpenSearchSearchStrategy
java.lang.Object
io.jmix.search.searching.impl.AbstractSearchStrategy
io.jmix.searchopensearch.searching.strategy.impl.PhraseOpenSearchSearchStrategy
- All Implemented Interfaces:
SearchStrategy
,OpenSearchSearchStrategy
@Component("search_PhraseOpenSearchSearchStrategy")
public class PhraseOpenSearchSearchStrategy
extends AbstractSearchStrategy
implements OpenSearchSearchStrategy
Class that encapsulates logic of
SearchStrategy
that searches documents with at least one field
matches the entire phrase - all input words in provided order.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureRequest
(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext) Configures OpenSearchSearchRequest
.getName()
Provides the name of this search strategy.Methods inherited from class io.jmix.search.searching.impl.AbstractSearchStrategy
toString
-
Field Details
-
searchUtils
-
-
Constructor Details
-
PhraseOpenSearchSearchStrategy
-
-
Method Details
-
getName
Description copied from interface:SearchStrategy
Provides the name of this search strategy. Name should be unique among all search strategies in application.- Specified by:
getName
in interfaceSearchStrategy
- Returns:
- name
-
configureRequest
public void configureRequest(org.opensearch.client.opensearch.core.SearchRequest.Builder requestBuilder, SearchContext searchContext) Description copied from interface:OpenSearchSearchStrategy
Configures OpenSearchSearchRequest
.The main step - create appropriate query based on provided
SearchContext
and set it to request.Configuration of another request parameters is optional.
Highlighting, size and offset shouldn't be configured here - these parameters will be overwritten.
- Specified by:
configureRequest
in interfaceOpenSearchSearchStrategy
- Parameters:
requestBuilder
- allows to configure search requestsearchContext
- contains details about search being performed
-