Class MatchQueryDescriptor<T>
A match query for a single field
Inheritance
MatchQueryDescriptor<T>
Assembly: OpenSearch.Client.dll
Syntax
[DataContract]
public class MatchQueryDescriptor<T> : FieldNameQueryDescriptorBase<MatchQueryDescriptor<T>, IMatchQuery, T>, IDescriptor, IMatchQuery, 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
|
Edit this page
View Source
MatchQueryType
Declaration
protected virtual string MatchQueryType { get; }
Property Value
Methods
|
Edit this page
View Source
Analyzer(string)
The analyzer name used to analyze the query
Declaration
public MatchQueryDescriptor<T> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
AutoGenerateSynonymsPhraseQuery(bool?)
Declaration
public MatchQueryDescriptor<T> AutoGenerateSynonymsPhraseQuery(bool? autoGenerateSynonymsPhraseQuery = true)
Parameters
Type |
Name |
Description |
bool? |
autoGenerateSynonymsPhraseQuery |
|
Returns
|
Edit this page
View Source
Fuzziness(Fuzziness)
Allows fuzzy matching based on the type of field being queried.
Declaration
public MatchQueryDescriptor<T> Fuzziness(Fuzziness fuzziness)
Parameters
Returns
|
Edit this page
View Source
FuzzyRewrite(MultiTermQueryRewrite)
Declaration
public MatchQueryDescriptor<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.
Declaration
public MatchQueryDescriptor<T> FuzzyTranspositions(bool? fuzzyTranspositions = true)
Parameters
Type |
Name |
Description |
bool? |
fuzzyTranspositions |
|
Returns
|
Edit this page
View Source
Lenient(bool?)
If set to true
will cause format based failures (like providing text to a numeric field)
to be ignored
Declaration
public MatchQueryDescriptor<T> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MaxExpansions(int?)
Controls the number of terms fuzzy queries will expand to. Defaults to 50
Declaration
public MatchQueryDescriptor<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.
Declaration
public MatchQueryDescriptor<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
Declaration
public MatchQueryDescriptor<T> Operator(Operator? op)
Parameters
Returns
|
Edit this page
View Source
PrefixLength(int?)
Set the prefix length for fuzzy queries. Default is 0
.
Declaration
public MatchQueryDescriptor<T> PrefixLength(int? prefixLength)
Parameters
Type |
Name |
Description |
int? |
prefixLength |
|
Returns
|
Edit this page
View Source
Query(string)
Declaration
public MatchQueryDescriptor<T> Query(string query)
Parameters
Type |
Name |
Description |
string |
query |
|
Returns
|
Edit this page
View Source
ZeroTermsQuery(ZeroTermsQuery?)
If the analyzer used removes all tokens in a query like a stop filter does, the default behavior is
to match no documents at all. In order to change that, ZeroTermsQuery can be used,
which accepts None (default) and All
which corresponds to a match_all query.
Declaration
public MatchQueryDescriptor<T> ZeroTermsQuery(ZeroTermsQuery? zeroTermsQuery)
Parameters
Returns
Implements
Extension Methods