-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[DOCS] Document script_score
float precision limit
#49402
Conversation
Scores produced by the `script_score` function are stored as positive, 32-bit floats in the `_score` field. This updates an existing admonition to document the 32-bits of precision limit.
Pinging @elastic/es-docs (>docs) |
Pinging @elastic/es-search (:Search/Search) |
As a result, scores are limited to 32-bits of precision. Larger numbers will | ||
lose precision during storage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I waiver over whether these sentences are needed. Any feedback appreciated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should clarify that all scores are 32-bit floats in Elasticsearch, this is not specific to this query. Then if a script_score produces a value that has greater accuracy than a 32-bit float, it will be automatically converted to the nearest 32-bit float.
Unrelated note: I find the word "storage" possibly confusing since we don't store scores on disk, which is what some users might think this statement implies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @jrodewig !
All document scores are positive 32-bit floating point numbers. However, this wasn't previously documented. This can result in surprising behavior, such as precision loss, for users when customizing scores using the function score query. This commit updates an existing admonition in the function score query docs to document the 32-bits precision limit. It also updates the search API reference docs to note that `_score` is a 32-bit float.
All document scores are positive 32-bit floating point numbers. However, this wasn't previously documented. This can result in surprising behavior, such as precision loss, for users when customizing scores using the function score query. This commit updates an existing admonition in the function score query docs to document the 32-bits precision limit. It also updates the search API reference docs to note that `_score` is a 32-bit float.
All document scores are positive 32-bit floating point numbers. However, this wasn't previously documented. This can result in surprising behavior, such as precision loss, for users when customizing scores using the function score query. This commit updates an existing admonition in the function score query docs to document the 32-bits precision limit. It also updates the search API reference docs to note that `_score` is a 32-bit float.
All document scores are positive 32-bit floating point numbers. However, this wasn't previously documented. This can result in surprising behavior, such as precision loss, for users when customizing scores using the function score query. This commit updates an existing admonition in the function score query docs to document the 32-bits precision limit.
Scores produced by the
script_score
function are stored as positive, 32-bit floats in the_score
field.This updates an existing admonition in the function score query docs to document the 32-bits of precision limit.
Closes #48845.