constant-score-query.asciidoc 541 B

12345678910111213141516171819202122
  1. [[query-dsl-constant-score-query]]
  2. === Constant Score Query
  3. A query that wraps another query and simply returns a
  4. constant score equal to the query boost for every document in the
  5. filter. Maps to Lucene `ConstantScoreQuery`.
  6. [source,js]
  7. --------------------------------------------------
  8. GET /_search
  9. {
  10. "query": {
  11. "constant_score" : {
  12. "filter" : {
  13. "term" : { "user" : "kimchy"}
  14. },
  15. "boost" : 1.2
  16. }
  17. }
  18. }
  19. --------------------------------------------------
  20. // CONSOLE