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

Mishandling of large numbers #69

Open
tomasz-sternumiot opened this issue Nov 22, 2022 · 0 comments
Open

Mishandling of large numbers #69

tomasz-sternumiot opened this issue Nov 22, 2022 · 0 comments

Comments

@tomasz-sternumiot
Copy link

Documents with big numeric values are presented incorrectly (rendered number is incorrect).

Please see very similar issue here: jqlang/jq#1959

Steps to reproduce:

  1. Create an index with a field of the unsigned_long type
PUT /my-test-index-000001
{
  "mappings": {
    "properties": {
      "big_number": { "type": "unsigned_long" }
    }
  }
}
  1. Index some data
POST /my-test-index-000001/_doc
{
    "big_number": 1234
}
POST /my-test-index-000001/_doc
{
    "big_number": 1016950844191088640
}
  1. Query for the data
GET /my-test-index-000001/_search
{
    "size": 10
}

Here is a query result:
Screenshot_20221122_120052

Incorrect because 1016950844191088640 != 1016950844191088600

  1. You can try to search for a particular values to see how it is really indexed
    4.1 Searching for rendered value → no results
GET /my-test-index-000001/_search
{
    "query": {
        "term": {
            "big_number": 1016950844191088600
        }
    },
    "size": 10
}

4.1 Searching for indexed value → document found

GET /my-test-index-000001/_search
{
    "query": {
        "term": {
            "big_number": 1016950844191088640
        }
    },
    "size": 10
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant