A newer version is available. For the latest information, see the
current release documentation.
Boosting Query Usage
editBoosting Query Usage
editFluent DSL example
editq .Boosting(c => c .Name("named_query") .Boost(1.1) .Positive(qq => qq.MatchAll(m => m.Name("filter"))) .Negative(qq => qq.MatchAll(m => m.Name("query"))) .NegativeBoost(1.12) )
Object Initializer syntax example
editnew BoostingQuery() { Name = "named_query", Boost = 1.1, PositiveQuery = new MatchAllQuery { Name = "filter" }, NegativeQuery = new MatchAllQuery() { Name = "query" }, NegativeBoost = 1.12 }
Example json output.
{ "boosting": { "_name": "named_query", "boost": 1.1, "negative": { "match_all": { "_name": "query" } }, "negative_boost": 1.12, "positive": { "match_all": { "_name": "filter" } } } }