Skip to content

Fields API on half_float doesn't lose precision #70260

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

Closed
nik9000 opened this issue Mar 10, 2021 · 1 comment · Fixed by #70653
Closed

Fields API on half_float doesn't lose precision #70260

nik9000 opened this issue Mar 10, 2021 · 1 comment · Fixed by #70653
Assignees
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@nik9000
Copy link
Member

nik9000 commented Mar 10, 2021

Usually the fields fetch API functions similarly to loading field values from doc values. Usually. It differs in a few cases like text. But whenever it does differ from doc_values we want to make that choice intentionally. So it turns out that when you use the fields API on a half_float field we'll parse the value from the _source as a 32 bit float and return it with that precision. But docvalue_fields for half_float returns 16 bit of precision. Do we really want that or did we do it by accident?

@nik9000 nik9000 added >bug discuss :Search/Search Search-related issues that do not fall into other categories labels Mar 10, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Mar 10, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@nik9000 nik9000 self-assigned this Mar 17, 2021
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Mar 22, 2021
This modifies the fields API to return values with half_float's
precision. This makes the fields API better reflect what we've indexed
which we'd like to to do in general. It does make the values that come
back "uglier" because things like `3.14` end up becoming `3.140625`. But
that is what is actually in the index so itsmore "real".

Closes elastic#70260
nik9000 added a commit that referenced this issue Mar 25, 2021
This modifies the fields API to return values with half_float's
precision. This makes the fields API better reflect what we've indexed
which we'd like to to do in general. It does make the values that come
back "uglier" because things like `3.14` end up becoming `3.140625`. But
that is what is actually in the index so itsmore "real".

Closes #70260
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Mar 25, 2021
This modifies the fields API to return values with half_float's
precision. This makes the fields API better reflect what we've indexed
which we'd like to to do in general. It does make the values that come
back "uglier" because things like `3.14` end up becoming `3.140625`. But
that is what is actually in the index so itsmore "real".

Closes elastic#70260
nik9000 added a commit that referenced this issue Mar 25, 2021
…70888)

This modifies the fields API to return values with half_float's
precision. This makes the fields API better reflect what we've indexed
which we'd like to to do in general. It does make the values that come
back "uglier" because things like `3.14` end up becoming `3.140625`. But
that is what is actually in the index so itsmore "real".

Closes #70260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants