Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Document script_score float precision limit #49402

Merged
merged 2 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/reference/query-dsl/function-score-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,15 @@ GET /_search
--------------------------------------------------
// TEST[setup:twitter]

NOTE: Scores produced by the `script_score` function must be non-negative,
otherwise an error will be thrown.
[IMPORTANT]
====
In {es}, all document scores are positive 32-bit floating point numbers.

If the `script_score` function produces a score with greater precision, it is
converted to the nearest 32-bit float.

Similarly, scores must be non-negative. Otherwise, {es} returns an error.
====

On top of the different scripting field values and expression, the
`_score` script parameter can be used to retrieve the score based on the
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/search/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Returned values are:
(Float)
Highest returned document `_score`.
+
The `_score` parameter is a floating point number
The `_score` parameter is a 32-bit floating point number
used to determine the relevance of the returned document.
+
This parameter value is `null` for requests
Expand All @@ -323,8 +323,8 @@ Returned parameters include:
* `_index`: Name of the index containing the returned document.
* `_id`: Unique identifier for the returned document.
This ID is only unique within the returned index.
* `_score`: Floating point number
used to determine the relevance of the returned document.
* `_score`: Positive 32-bit floating point number used to determine the
relevance of the returned document.
* `_source`: Object containing the original JSON body
passed for the document at index time.
--
Expand Down