Class MatchBoolPrefixQueryDescriptor<T>
A match_bool_prefix query analyzes its input and constructs a bool query from the terms.
Each term except the last is used in a term query. The last term is used in a prefix query.
Inheritance
MatchBoolPrefixQueryDescriptor<T>
Assembly: OpenSearch.Client.dll
Syntax
public class MatchBoolPrefixQueryDescriptor<T> : FieldNameQueryDescriptorBase<MatchBoolPrefixQueryDescriptor<T>, IMatchBoolPrefixQuery, T>, IDescriptor, IMatchBoolPrefixQuery, IFieldNameQuery, IQuery where T : class
Type Parameters
Properties
|
Edit this page
View Source
Conditionless
Whether the query is conditionless. A conditionless query is not serialized as part of the request
sent to OpenSearch.
Declaration
protected override bool Conditionless { get; }
Property Value
Overrides
Methods
|
Edit this page
View Source
Analyzer(string)
The analyzer to use for the query
Declaration
public MatchBoolPrefixQueryDescriptor<T> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
Fuzziness(Fuzziness)
Allows fuzzy matching based on the type of field being queried.
Applies only to the term sub queries constructed, and not the prefix query for the final term.
Declaration
public MatchBoolPrefixQueryDescriptor<T> Fuzziness(Fuzziness fuzziness)
Parameters
Returns
|
Edit this page
View Source
FuzzyRewrite(MultiTermQueryRewrite)
Controls how the query is rewritten if Fuzziness is set.
In this scenario, the default is TopTermsBlendedFreqs(int).
Applies only to the term sub queries constructed, and not the prefix query for the final term.
Declaration
public MatchBoolPrefixQueryDescriptor<T> FuzzyRewrite(MultiTermQueryRewrite rewrite)
Parameters
Returns
|
Edit this page
View Source
FuzzyTranspositions(bool?)
Sets whether transpositions are supported in fuzzy queries.
The default metric used by fuzzy queries to determine a match is the Damerau-Levenshtein
distance formula which supports transpositions. Setting transposition to false will
switch to classic Levenshtein distance.
If not set, Damerau-Levenshtein distance metric will be used.
Applies only to the term sub queries constructed, and not the prefix query for the final term.
Declaration
public MatchBoolPrefixQueryDescriptor<T> FuzzyTranspositions(bool? fuzzyTranspositions = true)
Parameters
Type |
Name |
Description |
bool? |
fuzzyTranspositions |
|
Returns
|
Edit this page
View Source
MaxExpansions(int?)
Controls the number of terms fuzzy queries will expand to. Defaults to 50
.
Applies only to the term sub queries constructed, and not the prefix query for the final term.
Declaration
public MatchBoolPrefixQueryDescriptor<T> MaxExpansions(int? maxExpansions)
Parameters
Type |
Name |
Description |
int? |
maxExpansions |
|
Returns
|
Edit this page
View Source
MinimumShouldMatch(MinimumShouldMatch)
A value controlling how many "should" clauses in the resulting boolean query should match.
It can be an absolute value, a percentage or a combination of both.
Applies to the bool query constructed.
Declaration
public MatchBoolPrefixQueryDescriptor<T> MinimumShouldMatch(MinimumShouldMatch minimumShouldMatch)
Parameters
Returns
|
Edit this page
View Source
Operator(Operator?)
The operator used if no explicit operator is specified.
The default operator is Or.
Applies to the bool query constructed.
Declaration
public MatchBoolPrefixQueryDescriptor<T> Operator(Operator? op)
Parameters
Returns
|
Edit this page
View Source
PrefixLength(int?)
Set the prefix length for fuzzy queries. Default is 0
.
Applies only to the term sub queries constructed, and not the prefix query for the final term.
Declaration
public MatchBoolPrefixQueryDescriptor<T> PrefixLength(int? prefixLength)
Parameters
Type |
Name |
Description |
int? |
prefixLength |
|
Returns
|
Edit this page
View Source
Query(string)
Declaration
public MatchBoolPrefixQueryDescriptor<T> Query(string query)
Parameters
Type |
Name |
Description |
string |
query |
|
Returns
Implements
Extension Methods