-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Expose half-floats. #18887
Expose half-floats. #18887
Conversation
When possible, it is often more efficient to store floating-point data into an | ||
integer using a scaling factor. For instance, it is more efficient to store | ||
percentages as integers between 0 and 100 than as floating-point numbers between 0 | ||
and 1. Another example would be prices: it will be bore efficient to store prices |
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.
bore -> more
LGTM |
Thanks @rjernst! |
They have been implemented in https://issues.apache.org/jira/browse/LUCENE-7289. Ranges are implemented so that the accuracy loss only occurs at index time, which means that if you are searching for values between A and B, the query will match exactly all documents whose value rounded to the closest half-float point is between A and B.
e87fbb7
to
9ffb2ff
Compare
I did some unscientific benchmarking in order to make sure that half floats do not make things too slow. Query times are the same with floats and half floats, which makes sense since queries operate directly on the encoded representation anyway. However, a sum aggregation on the whole dataset runs about 8% slower with half floats due to the fact that half float bits are converted to doubles using software ( |
Elasticsearch added a couple of new numeric datatypes, which means we need to update our type casting list to include them. Kibana should see them as "numbers" so they work properly in searches and aggs. Fixes elastic#7782 Related elastic/elasticsearch#18887 Related elastic/elasticsearch#19264
Elasticsearch added a couple of new numeric datatypes, which means we need to update our type casting list to include them. Kibana should see them as "numbers" so they work properly in searches and aggs. Fixes elastic#7782 Related elastic/elasticsearch#18887 Related elastic/elasticsearch#19264 Former-commit-id: 298ee35
They have been implemented in https://issues.apache.org/jira/browse/LUCENE-7289.
Ranges are implemented so that the accuracy loss only occurs at index time,
which means that if you are searching for values between A and B, the query will
match exactly all documents whose value rounded to the closest half-float point
is between A and B.