elasticsearch/elasticsearch — pull request #4551 by jpountz (2013-12-26 17:50:22+00:00)
Title: Make RangeAggregator a MULTI_BUCKETS aggregator.

Until now, RangeAggregator was a PER_BUCKET aggregator, expecting to be always
collected with owningBUcketOrdinal == 0. However, since the number of buckets
it creates is known in advance, it can be changed to a MULTI_BUCKETS aggregator
by just multiplying the bucket ordinal by the number of ranges.

This makes aggregations that have ranges as sub aggregations of PER_BUCKET
aggregators more efficient.

Close #4550