OpenSearch/docs/reference/query-dsl/boosting-query.asciidoc
Isabel Drost-Fromm 4c02e97bcd Add back doc execution to query dsl.
Relates to #18211

This reverts commit 20aafb1196192d4f9f7faea8ce9a36b278e501a1.
2016-05-24 12:43:41 +02:00

31 lines
759 B
Plaintext

[[query-dsl-boosting-query]]
=== Boosting Query
The `boosting` query can be used to effectively demote results that
match a given query. Unlike the "NOT" clause in bool query, this still
selects documents that contain undesirable terms, but reduces their
overall score.
[source,js]
--------------------------------------------------
GET /_search
{
"query": {
"boosting" : {
"positive" : {
"term" : {
"field1" : "value1"
}
},
"negative" : {
"term" : {
"field2" : "value2"
}
},
"negative_boost" : 0.2
}
}
}
--------------------------------------------------
// CONSOLE