Weird aggregation issue


we ran into a weird problem with aggregations on our production cluster (3 nodes all replicating ~60G index).

Problem: aggregation (sum, min, max - all behaving the same) of one field (called 'dobirka') returns about 70% of the time totally incorrect results. Aggregations on other fields work as expected. Does this suggest some index corruption?

My query:
curl -XPOST "http://selen:9200/kolos-index/VyhledavaniCesta/_search" -d ' { "query": {
"filtered" : {
"filter" : {
"term" : { "immutableId" : "701546403" }
"_source": "dobirka",

Correct output, which I get about 30% of the time:

Incorrect output:


Note that the query filters out one document only (see output - { "total": 1 }). The field is mapped as 'double', I checked that in the mapping. The value of the field is clearly visible in the _source, 25752.0.

Cloning the index to our test cluster leads to correct results 100% of the time.

I've tried restarting our nodes one by one, but it doesn't help.

Clues will be greatly appreciated! Thanks!

EDIT: just to add, all our nodes are running ES 1.5.0


I think you are hitting the same issue as described in this post: Sum Aggregation returning very small, unrelated values

Unfortunately this is a known bug in 1.x and has been fixed in the upcoming 2.0 release

Thank you, it looks like I am hitting the same issue.

However, I don't understand how it happened, since the aggregations used to work correctly and we were indexing double values from the beginning. All nodes report show 'double' mapping for this field.

Also, why is the aggregation result incorrect only sometimes? This would suggest only some shards are corrupted, but turning off individual nodes does not help.