The AutoDateHistogram can perform final reduce multiple times when it needs to merge buckets together.
If a terms aggregation is nested under an auto-date histogram, running multiple final reduce may result in a loss of precision since each final reduce will prune the list of terms prematurely. So if the terms aggregation is sorted by count, the counts and ordering of the terms within the bucket may be wrong due to the merges that the auto-date histogram performed.
We should add the ability to run partial reduce as part of a final reduce in order to allow the merging of buckets in any parent aggregation. That would allow the terms aggregation to preserve all buckets when merging parent buckets incrementally in the auto-date histogram.
The AutoDateHistogram can perform final reduce multiple times when it needs to merge buckets together. If a
terms
aggregation is nested under an auto-date histogram, running multiple final reduce may result in a loss of precision since each final reduce will prune the list of terms prematurely. So if theterms
aggregation is sorted by count, the counts and ordering of the terms within the bucket may be wrong due to the merges that the auto-date histogram performed. We should add the ability to run partial reduce as part of a final reduce in order to allow the merging of buckets in any parent aggregation. That would allow theterms
aggregation to preserve all buckets when merging parent buckets incrementally in the auto-date histogram.