Interface IMultiMatchQuery
A match query across multiple fields.
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public interface IMultiMatchQuery : IQuery
Properties
| Edit this page View SourceAnalyzer
The analyzer name used to analyze the query
Declaration
[DataMember(Name = "analyzer")]
string Analyzer { get; set; }
Property Value
Type | Description |
---|---|
string |
AutoGenerateSynonymsPhraseQuery
Declaration
[DataMember(Name = "auto_generate_synonyms_phrase_query")]
bool? AutoGenerateSynonymsPhraseQuery { get; set; }
Property Value
Type | Description |
---|---|
bool? |
CutoffFrequency
A cutoff frequency that allows specifying an absolute or relative document frequency where high frequency terms are moved into an optional subquery and are only scored if one of the low frequency (below the cutoff) terms in the case of Or, or all of the low frequency terms in the case of an And match.
Declaration
[DataMember(Name = "cutoff_frequency")]
double? CutoffFrequency { get; set; }
Property Value
Type | Description |
---|---|
double? |
Fields
The fields to perform the query against.
Declaration
[DataMember(Name = "fields")]
Fields Fields { get; set; }
Property Value
Type | Description |
---|---|
Fields |
Fuzziness
Allows fuzzy matching based on the type of field being queried. Cannot be used with the CrossFields, Phrase or PhrasePrefix types.
Declaration
[DataMember(Name = "fuzziness")]
Fuzziness Fuzziness { get; set; }
Property Value
Type | Description |
---|---|
Fuzziness |
FuzzyRewrite
Controls how the query is rewritten if Fuzziness is set. In this scenario, the default is TopTermsBlendedFreqs(int).
Declaration
[DataMember(Name = "fuzzy_rewrite")]
MultiTermQueryRewrite FuzzyRewrite { get; set; }
Property Value
Type | Description |
---|---|
MultiTermQueryRewrite |
FuzzyTranspositions
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
[DataMember(Name = "fuzzy_transpositions")]
bool? FuzzyTranspositions { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Lenient
If set to true
will cause format based failures (like providing text to a numeric field)
to be ignored
Declaration
[DataMember(Name = "lenient")]
bool? Lenient { get; set; }
Property Value
Type | Description |
---|---|
bool? |
MaxExpansions
Controls the number of terms fuzzy queries will expand to. Defaults to 50
Declaration
[DataMember(Name = "max_expansions")]
int? MaxExpansions { get; set; }
Property Value
Type | Description |
---|---|
int? |
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
[DataMember(Name = "minimum_should_match")]
MinimumShouldMatch MinimumShouldMatch { get; set; }
Property Value
Type | Description |
---|---|
MinimumShouldMatch |
Operator
The operator used if no explicit operator is specified. The default operator is Or
Declaration
[DataMember(Name = "operator")]
Operator? Operator { get; set; }
Property Value
Type | Description |
---|---|
Operator? |
Remarks
BestFields and MostFields types are field-centric ; they generate a match query per field. This means that Operator and MinimumShouldMatch are applied to each field individually, which is probably not what you want. Consider using CrossFields.
PrefixLength
Set the prefix length for fuzzy queries. Default is 0
.
Declaration
[DataMember(Name = "prefix_length")]
int? PrefixLength { get; set; }
Property Value
Type | Description |
---|---|
int? |
Query
The query to execute
Declaration
[DataMember(Name = "query")]
string Query { get; set; }
Property Value
Type | Description |
---|---|
string |
Slop
How far apart terms are allowed to be while still considering the document to be a match.
Declaration
[DataMember(Name = "slop")]
int? Slop { get; set; }
Property Value
Type | Description |
---|---|
int? |
TieBreaker
Used to influence how the score is calculated for BestFields. If specified, score is calculated using
Declaration
[DataMember(Name = "tie_breaker")]
double? TieBreaker { get; set; }
Property Value
Type | Description |
---|---|
double? |
Type
How the fields should be combined to build the text query. Default is BestFields
Declaration
[DataMember(Name = "type")]
TextQueryType? Type { get; set; }
Property Value
Type | Description |
---|---|
TextQueryType? |
UseDisMax
By default, a IMultiMatchQuery generates a match clause per field, then wraps them
in a IDisMaxQuery. By setting UseDisMax to false
,
they will be wrapped in a IBoolQuery instead.
Declaration
[DataMember(Name = "use_dis_max")]
bool? UseDisMax { get; set; }
Property Value
Type | Description |
---|---|
bool? |
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
[DataMember(Name = "zero_terms_query")]
ZeroTermsQuery? ZeroTermsQuery { get; set; }
Property Value
Type | Description |
---|---|
ZeroTermsQuery? |