NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Match Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Match Usage
editFluent DSL example
editq
.Match(c => c
.Field(p => p.Description)
.Analyzer("standard")
.Boost(1.1)
.CutoffFrequency(0.001)
.Query("hello world")
.Fuzziness(Fuzziness.AutoLength(3, 6))
.Lenient()
.FuzzyTranspositions()
.MinimumShouldMatch(2)
.Operator(Operator.Or)
.FuzzyRewrite(MultiTermQueryRewrite.TopTermsBlendedFreqs(10))
.Name("named_query")
)
Object Initializer syntax example
editnew MatchQuery
{
Field = Field<Project>(p => p.Description),
Analyzer = "standard",
Boost = 1.1,
Name = "named_query",
CutoffFrequency = 0.001,
Query = "hello world",
Fuzziness = Fuzziness.AutoLength(3, 6),
FuzzyTranspositions = true,
MinimumShouldMatch = 2,
FuzzyRewrite = MultiTermQueryRewrite.TopTermsBlendedFreqs(10),
Lenient = true,
Operator = Operator.Or
}
Example json output.
{
"match": {
"description": {
"_name": "named_query",
"boost": 1.1,
"query": "hello world",
"analyzer": "standard",
"fuzzy_rewrite": "top_terms_blended_freqs_10",
"fuzziness": "AUTO:3,6",
"fuzzy_transpositions": true,
"cutoff_frequency": 0.001,
"lenient": true,
"minimum_should_match": 2,
"operator": "or"
}
}
}