IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Boosting Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Boosting 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"
}
}
}
}