Skip to content

Commit

Permalink
Add warning scores are floats (#42667)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayya-sharipova committed May 29, 2019
1 parent e8c22b2 commit 6beeb35
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docs/reference/query-dsl/query_filter_context.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ GET /_search
"query": { <1>
"bool": { <2>
"must": [
{ "match": { "title": "Search" }}, <2>
{ "match": { "content": "Elasticsearch" }} <2>
{ "match": { "title": "Search" }},
{ "match": { "content": "Elasticsearch" }}
],
"filter": [ <3>
{ "term": { "status": "published" }}, <4>
{ "range": { "publish_date": { "gte": "2015-01-01" }}} <4>
{ "term": { "status": "published" }},
{ "range": { "publish_date": { "gte": "2015-01-01" }}}
]
}
}
Expand All @@ -68,11 +68,16 @@ GET /_search
<2> The `bool` and two `match` clauses are used in query context,
which means that they are used to score how well each document
matches.
<3> The `filter` parameter indicates filter context.
<4> The `term` and `range` clauses are used in filter context.
They will filter out documents which do not match, but they will
<3> The `filter` parameter indicates filter context. Its `term` and
`range` clauses are used in filter context. They will filter out
documents which do not match, but they will
not affect the score for matching documents.

WARNING: Scores calculated for queries in query context are represented
as single precision floating point numbers; they have only
24 bits for significand's precision. Score calculations that exceed the
significand's precision will be converted to floats with loss of precision.

TIP: Use query clauses in query context for conditions which should affect the
score of matching documents (i.e. how well does the document match), and use
all other query clauses in filter context.

0 comments on commit 6beeb35

Please sign in to comment.