mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
a0af88e996
This commit makes queries and filters parsed the same way using the QueryParser abstraction. This allowed to remove duplicate code that we had for similar queries/filters such as `range`, `prefix` or `term`.
27 lines
659 B
Plaintext
27 lines
659 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]
|
|
--------------------------------------------------
|
|
{
|
|
"boosting" : {
|
|
"positive" : {
|
|
"term" : {
|
|
"field1" : "value1"
|
|
}
|
|
},
|
|
"negative" : {
|
|
"term" : {
|
|
"field2" : "value2"
|
|
}
|
|
},
|
|
"negative_boost" : 0.2
|
|
}
|
|
}
|
|
--------------------------------------------------
|