[[query-dsl-constant-score-query]]
=== Constant score query
++++
Constant score
++++
Wraps a <> and returns every matching
document with a <> equal to the `boost`
parameter value.
[source,js]
----
GET /_search
{
"query": {
"constant_score" : {
"filter" : {
"term" : { "user" : "kimchy"}
},
"boost" : 1.2
}
}
}
----
// CONSOLE
[[constant-score-top-level-params]]
==== Top-level parameters for `constant_score`
`filter`::
+
--
<> you wish to run. Any returned documents
must match this query. Required.
Filter queries do not calculate <>. To
speed up performance, {es} automatically caches frequently used filter queries.
--
`boost`::
Floating point number used as the constant <> for every document matching the `filter` query. Default is `1.0`.
Optional.