WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Multi Match Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Multi Match Usage
editFluent DSL example
editq .MultiMatch(c => c .Fields(f => f.Field(p=>p.Description).Field("myOtherField")) .Query("hello world") .Analyzer("standard") .Boost(1.1) .Slop(2) .Fuzziness(Fuzziness.Auto) .PrefixLength(2) .MaxExpansions(2) .Operator(Operator.Or) .MinimumShouldMatch(2) .FuzzyRewrite(MultiTermQueryRewrite.ConstantScoreBoolean) .TieBreaker(1.1) .CutoffFrequency(0.001) .Lenient() .ZeroTermsQuery(ZeroTermsQuery.All) .Name("named_query") )
Object Initializer syntax example
editnew MultiMatchQuery { Fields = Field<Project>(p=>p.Description).And("myOtherField"), Query = "hello world", Analyzer = "standard", Boost = 1.1, Slop = 2, Fuzziness = Fuzziness.Auto, PrefixLength = 2, MaxExpansions = 2, Operator = Operator.Or, MinimumShouldMatch = 2, FuzzyMultiTermQueryRewrite = MultiTermQueryRewrite.ConstantScoreBoolean, TieBreaker = 1.1, CutoffFrequency = 0.001, Lenient = true, ZeroTermsQuery = ZeroTermsQuery.All, Name = "named_query", }
Example json output.
{ "multi_match": { "_name": "named_query", "boost": 1.1, "query": "hello world", "analyzer": "standard", "fuzzy_rewrite": "constant_score_boolean", "fuzziness": "AUTO", "cutoff_frequency": 0.001, "prefix_length": 2, "max_expansions": 2, "slop": 2, "lenient": true, "tie_breaker": 1.1, "minimum_should_match": 2, "operator": "or", "fields": [ "description", "myOtherField" ], "zero_terms_query": "all" } }
Multi match with boost usage
editFluent DSL example
editq .MultiMatch(c => c //.Fields(f => f.Field(p=>p.Description, 2.2).Field("myOtherField^0.3")) .Fields(Field<Project>(p=>p.Description, 2.2).And("myOtherField^0.3")) .Query("hello world") )
Object Initializer syntax example
editnew MultiMatchQuery { Fields = Field<Project>(p=>p.Description, 2.2).And("myOtherField^0.3"), Query = "hello world", }
Example json output.
{ "multi_match": { "query": "hello world", "fields": [ "description^2.2", "myOtherField^0.3" ] } }
Was this helpful?
Thank you for your feedback.