A match query analyzes the input text and uses that analyzed text to query the index.
More...
#include <couchbase/match_query.hxx>
|
| match_query (std::string match) |
| Create a new match query.
|
|
auto | prefix_length (std::uint32_t length) -> match_query & |
| Require that the term also have the same prefix of the specified length (must be positive).
|
|
auto | analyzer (std::string analyzer_name) -> match_query & |
| Analyzers are used to transform input text into a stream of tokens for indexing.
|
|
auto | field (std::string field_name) -> match_query & |
| If a field is specified, only terms in that field will be matched.
|
|
auto | fuzziness (std::uint32_t fuzziness) -> match_query & |
| Perform fuzzy matching.
|
|
auto | match_operator (couchbase::match_operator concatenation_operator) -> match_query & |
| Defines how the individual match terms should be logically concatenated.
|
|
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).
|
|
A match query analyzes the input text and uses that analyzed text to query the index.
An attempt is made to use the same analyzer that was used when the field was indexed.
Match documents with both "location"
and "hostel"
terms in the field reviews.content
, ensuring common prefix length 4
, maximum fuzziness and select standard analyzer.
.
field(
"reviews.content")
.analyzer("standard")
.fuzziness(2)
.prefix_length(4)
- See also
- https://docs.couchbase.com/server/current/fts/fts-supported-queries-match.html server documentation
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ match_query()
Create a new match query.
- Parameters
-
match | the input string to be matched against |
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ analyzer()
auto analyzer |
( |
std::string | analyzer_name | ) |
-> match_query&
|
|
inline |
Analyzers are used to transform input text into a stream of tokens for indexing.
The Server comes with built-in analyzers and the users can create their own.
- Parameters
-
analyzer_name | the name of the analyzer used |
- Returns
- this query for chaining purposes.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ encode()
auto encode |
( |
| ) |
const -> encoded_search_query |
|
nodiscardoverridevirtual |
- Returns
- encoded representation of the query.
- Since
- 1.0.0
- Internal
- Internal interface
Implements search_query.
◆ field()
If a field is specified, only terms in that field will be matched.
This can also affect the used analyzer if one isn't specified explicitly.
- Parameters
-
field_name | name of the field to be matched |
- Returns
- this query for chaining purposes.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ fuzziness()
auto fuzziness |
( |
std::uint32_t | fuzziness | ) |
-> match_query&
|
|
inline |
Perform fuzzy matching.
If the fuzziness parameter is set to a non-zero integer the analyzed text will be matched with the specified level of fuzziness.
- Parameters
-
fuzziness | level of fuzziness (the maximum supported fuzziness is 2). |
- Returns
- this query for chaining purposes.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ match_operator()
Defines how the individual match terms should be logically concatenated.
- Parameters
-
concatenation_operator | operator to be used |
- Returns
- this query for chaining purposes.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
◆ prefix_length()
auto prefix_length |
( |
std::uint32_t | length | ) |
-> match_query&
|
|
inline |
Require that the term also have the same prefix of the specified length (must be positive).
- Parameters
-
length | the length of the term prefix |
- Returns
- this query for chaining purposes.
- Since
- 1.0.0
- Committed
- Generally available API and should be preferred in production
The documentation for this class was generated from the following file: