Coder Social home page Coder Social logo

Comments (4)

mgodwan avatar mgodwan commented on September 6, 2024 1

This seems like a precision issue (32 vs 64 bits) to me.

Can be reproduced with:

 NumericUtils.sortableLongToDouble(NumericUtils.doubleToSortableLong(0.000001f)) // Returns 9.999999974752427E-7

If we use double for the initial value

 NumericUtils.sortableLongToDouble(NumericUtils.doubleToSortableLong(0.000001d)) // Returns  1.0E-6

@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

from opensearch.

kkewwei avatar kkewwei commented on September 6, 2024

@mgodwan yes if it's a bug, I'm pleasure to solve it.

from opensearch.

getsaurabh02 avatar getsaurabh02 commented on September 6, 2024

@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"

from opensearch.

kkewwei avatar kkewwei commented on September 6, 2024

@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.

from opensearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.