-
Notifications
You must be signed in to change notification settings - Fork 1.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
[BUG] the aggregation result in float field type is inaccurate #14966
Comments
This seems like a precision issue (32 vs 64 bits) to me. Can be reproduced with:
If we use double for the initial value
@kkewwei Since the mapping type used here is float, the precision is lost when the value is actually parsed as a number and you get the nearest value representable as float and is used in bucket creation. The hit returned returns the source as it was ingested (i.e. the source content itself), and hence shows the provided value. Using double in mappings should solve this |
@mgodwan yes if it's a bug, I'm pleasure to solve it. |
@mgodwan let us know if this still needs to be fixed? we are assuming this is just a mapping issue based on the comment " mappings should solve this" |
I think we should fix it, as float field type is common, when it is used in aggregation, the bucket name of the aggregation response may be inaccurate, which is confusing to user. We can't force the user not to use float field type in aggregation. |
Describe the bug
When aggregating in float field type, the returned result may be not accurate, but the query result is accurate.
Related component
Search:Aggregations
To Reproduce
Additional Details
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: