boosting-query.asciidoc 759 B

123456789101112131415161718192021222324252627282930
  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. GET /_search
  10. {
  11. "query": {
  12. "boosting" : {
  13. "positive" : {
  14. "term" : {
  15. "field1" : "value1"
  16. }
  17. },
  18. "negative" : {
  19. "term" : {
  20. "field2" : "value2"
  21. }
  22. },
  23. "negative_boost" : 0.2
  24. }
  25. }
  26. }
  27. --------------------------------------------------
  28. // CONSOLE