2015-05-05 02:27:52 -04:00
|
|
|
[[query-dsl-constant-score-query]]
|
2015-06-03 19:59:22 -04:00
|
|
|
=== Constant Score Query
|
2015-05-05 02:27:52 -04:00
|
|
|
|
|
|
|
A query that wraps another query and simply returns a
|
|
|
|
constant score equal to the query boost for every document in the
|
|
|
|
filter. Maps to Lucene `ConstantScoreQuery`.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2016-05-09 10:13:07 -04:00
|
|
|
GET /_search
|
2015-05-05 02:27:52 -04:00
|
|
|
{
|
2016-05-10 06:42:17 -04:00
|
|
|
"query": {
|
|
|
|
"constant_score" : {
|
|
|
|
"filter" : {
|
|
|
|
"term" : { "user" : "kimchy"}
|
|
|
|
},
|
2016-05-12 06:30:33 -04:00
|
|
|
"boost" : 1.2
|
2016-05-10 06:42:17 -04:00
|
|
|
}
|
2015-05-05 02:27:52 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2016-05-09 10:13:07 -04:00
|
|
|
// CONSOLE
|