boosting-query.asciidoc 660 B

1234567891011121314151617181920212223242526
  1. [[query-dsl-boosting-query]]
  2. === Boosting Query
  3. The `boosting` query can be used to effectively demote results that
  4. match a given query. Unlike the "NOT" clause in bool query, this still
  5. selects documents that contain undesirable terms, but reduces their
  6. overall score.
  7. [source,js]
  8. --------------------------------------------------
  9. {
  10. "boosting" : {
  11. "positive" : {
  12. "term" : {
  13. "field1" : "value1"
  14. }
  15. },
  16. "negative" : {
  17. "term" : {
  18. "field2" : "value2"
  19. }
  20. },
  21. "negative_boost" : 0.2
  22. }
  23. }
  24. --------------------------------------------------