So when i am doing the same query for other indexes, it gives me the correct sum but for one it's exceedingly high and incorrect. I tried checking by downloading all fields and summing them up in python and its giving me the correct number which leds me to believe that it might be related to my query ? I checked the mapping for the field "revenue" and it's "double".
Can you give an example of a correct response (from one of the other indices) and an example of the erroneous response too? Also can you show the mappings for the index which is producing the errors.
The Incorrect response is something like this : 4676552119224959000
whereas a correct response is usually: 250000
If you want i can paste the complete mapping in the gist link
Is this is being caused by sometimes the index, field is updated by "long" and sometimes it's updated as "double"? Shouldn't this happen with all indexes , since i am using the same upload script to update all my indices.
It looks like you are running into the issue I linked above. This happens only rarely (hence why you only see it on one of your indices) when two shards dynamically map the same field as different types at the same time (one shard may see a double value and map the field to a double whilst the other sees a long value and maps the field to a long). This is a known bug in 1.x and will be fixed in the upcoming 2.0 release (the beta for this release is available now but DO NOT use this in production). To work around this bug you will need to re-index your data into an index with explicit mappings for your fields (especially your numeric fields).
i just checked the mapping on my other node, even the other node contains the same mapping though, do you still think it's due to incorrect mapping types.
For reindexing, can i just query for whole data -> mention explicitly the mapping -> insert data into new index -> delete the old index . This whole process i will be doing using python.
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.