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

Expose half-floats. #18887

Merged
merged 1 commit into from
Jun 16, 2016
Merged

Expose half-floats. #18887

merged 1 commit into from
Jun 16, 2016

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Jun 15, 2016

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.

@jpountz jpountz added >feature :Search Foundations/Mapping Index mappings, including merging and defining field types v5.0.0-alpha4 labels Jun 15, 2016
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bore -> more

@rjernst
Copy link
Member

rjernst commented Jun 15, 2016

LGTM

@jpountz
Copy link
Contributor Author

jpountz commented Jun 15, 2016

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.
@jpountz jpountz force-pushed the feature/half_floats branch from e87fbb7 to 9ffb2ff Compare June 16, 2016 07:47
@jpountz jpountz merged commit 9ffb2ff into elastic:master Jun 16, 2016
@jpountz jpountz deleted the feature/half_floats branch June 16, 2016 07:47
@polyfractal
Copy link
Contributor

emot-toot

@jpountz
Copy link
Contributor Author

jpountz commented Jul 4, 2016

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 (HalfFloatPoint.shortBitsToHalfFloat).

Bargs added a commit to Bargs/kibana that referenced this pull request Jul 22, 2016
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
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :Search Foundations/Mapping Index mappings, including merging and defining field types v5.0.0-alpha4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants