@Component(value="search_PhraseSearchStrategy") public class PhraseSearchStrategy extends AbstractSearchStrategy
SearchStrategy that searches documents with at least one field matches entire phrase - all input terms in provided order.| Constructor and Description |
|---|
PhraseSearchStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
configureRequest(org.elasticsearch.action.search.SearchRequest searchRequest,
SearchContext searchContext)
Configures Elasticsearch
SearchRequest. |
java.lang.String |
getName()
Provides the name of this search strategy.
|
toStringpublic java.lang.String getName()
SearchStrategypublic void configureRequest(org.elasticsearch.action.search.SearchRequest searchRequest,
SearchContext searchContext)
SearchStrategySearchRequest.
The main step - create appropriate query based on provided SearchContext and set it to request.
Configuration of another request parameters is optional. Custom highlighting can be configured here. If it wasn't - the default one will be used.
Size and offset shouldn't be configured here - these parameters will be overwritten.
searchRequest - Elasticsearch SearchRequestsearchContext - SearchContext