File tree 1 file changed +21
-7
lines changed 1 file changed +21
-7
lines changed Original file line number Diff line number Diff line change 1
1
[[query-dsl-constant-score-query]]
2
2
=== Constant Score Query
3
3
4
- A query that wraps another query and simply returns a
5
- constant score equal to the query boost for every document in the
6
- filter. Maps to Lucene `ConstantScoreQuery` .
4
+ Wraps a << query-dsl-bool-query, filter query>> and returns every matching
5
+ document with a << query-filter-context, relevance score>> equal to the `boost`
6
+ parameter value .
7
7
8
8
[source,js]
9
- --------------------------------------------------
9
+ ----
10
10
GET /_search
11
11
{
12
12
"query": {
@@ -18,8 +18,22 @@ GET /_search
18
18
}
19
19
}
20
20
}
21
- --------------------------------------------------
21
+ ----
22
22
// CONSOLE
23
23
24
- Filter clauses are executed in <<query-filter-context,filter context>>,
25
- meaning that scoring is ignored and clauses are considered for caching.
24
+ [[constant-score-top-level-params]]
25
+ ==== Top-level parameters for `constant_score`
26
+ `filter`::
27
+ +
28
+ --
29
+ <<query-dsl-bool-query, Filter query>> you wish to run. Any returned documents
30
+ must match this query. Required.
31
+
32
+ Filter queries do not calculate <<query-filter-context, relevance scores>>. To
33
+ speed up performance, {es} automatically caches frequently used filter queries.
34
+ --
35
+
36
+ `boost`::
37
+ Floating point number used as the constant <<query-filter-context, relevance
38
+ score>> for every document matching the `filter` query. Default is `1.0`.
39
+ Optional.
You can’t perform that action at this time.
0 commit comments