The input text is analyzed and a phrase query is built with the terms resulting from the analysis.
More...
|
| match_phrase_query (std::string match_phrase) |
| Create a new match phrase query.
|
|
auto | analyzer (std::string analyzer_name) -> match_phrase_query & |
| Analyzers are used to transform input text into a stream of tokens for indexing.
|
|
auto | field (std::string field_name) -> match_phrase_query & |
| If a field is specified, only terms in that field will be matched.
|
|
auto | encode () const -> encoded_search_query override |
|
virtual | ~search_query ()=default |
|
template<typename derived_query = search_query, std::enable_if_t< std::is_base_of_v< search_query, derived_query >, bool > = true> |
auto | boost (double boost) -> derived_query & |
| The boost parameter is used to increase the relative weight of a clause (with a boost greater than 1) or decrease the relative weight (with a boost between 0 and 1).
|
|
The input text is analyzed and a phrase query is built with the terms resulting from the analysis.
This type of query searches for terms occurring in the specified positions and offsets. This depends on term vectors, which are consulted to determine phrase distance.
For example, a match phrase query for "location for functions"
is matched with "locate the
function"
, if the standard analyzer is used: this analyzer uses a stemmer, which tokenizes "location"
and "locate"
to "locat"
, and reduces "functions"
and "function"
to "function"
. Additionally, the analyzer employs stop removal, which removes small and less significant words from input and target text, so that matches are attempted on only the more significant elements of vocabulary: in this case "for"
and "the"
are removed. Following this processing, the tokens "locat"
and "function"
are recognized as common to both input and target; and also as being both in the same sequence as, and at the same distance from one another; and therefore a match is made.
- See also
- https://docs.couchbase.com/server/current/fts/fts-supported-queries-match-phrase.html
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production