RRSR
(Raj Rajeshwar Singh Rathore)
September 6, 2018, 6:59am
1
I created an index using the below endpoint:
PUT test/doc/1
{
"id":1,
"test_long": 2305843036566024123
}
Then when I try to get the same document using:
GET test/doc/1
The result I get is:
{
"_index": "test",
"_type": "doc",
"_id": "1",
"_version": 11,
"found": true,
"_source": {
"id": 1,
"test_long": 2305843036566024000
}
}
The issue is that I persisted 2305843036566024123
but what I get back is 2305843036566024000
so I lose the last 3 digits.
So what is the reason behind this and how can I fix the same?
tamara
(Tamara Rosini)
September 6, 2018, 7:44am
2
Hi,
You are not losing the last digits, if you do a curl request as an example:
curl -XGET localhost:9200/test/doc/1
Also you can try:
GET test/_search
{
"query": {
"match": {
"test_long": 2305843036566024123
}
}
}
You can see the value is there and complete. You did not lose anything. This is a problem that is happening when displaying the value.
1 Like
RRSR
(Raj Rajeshwar Singh Rathore)
September 7, 2018, 4:12am
3
Thanks, @tamara . It shows the correct value in the curl request. It is just due to the limitation of JavaScript that it is rounding off the last 3 digits.
1 Like
system
(system)
Closed
October 5, 2018, 4:12am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.