The values are coming from a long field in Java and are inserted to ES via the Java API.
When doing a filter search in Kibana to the domainId field and searching for a specific value, I always get 0 results.
Also, when doing the query via the GET URL, I also get no results.
One thing I've noticed is that for small values, I do get results.
Any idea what may cause this behavior ?
I have tried to play with the formatting of the field according to these posts but none of them seems to work.
At the moment I see no solution to this problem other than changing the field type to string.
I checked the source system and found out that the value that has been sent to Elasticsearch has been 7352157926092658501 (last four digits are different). When I use the original value to query the index I get one result:
Looks like nobody is looking into this but nevertheless I want to share what I've found out:
Seems like it is related to the fact that every number in JavaScript is internally stored as "Double" with 53-Bit mantissa. So every large number that doesn't fit into these 53 bits is truncated which explaines the deviation. Worst case is that you have more than one large value which is truncated to the same 53-bit value.
Looks like the only solution is to index such values as strings. I would have expected some kind of error message when inserting such values as numbers into an index...
If you want to try it out by yourself just open a JavaScript console in your browser:
var a = 7352157926092658505;
var b = 7352157926092658504;
a === b;
Let's assume I do this: Which value do I see when I query the document via REST api? As the value is stored as number I would assume that I see the (wrong) truncated value again. If the Elasticsearch stack is using JavaScript for the mapping it is stored incorrectly either.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.