elasticsearch/elasticsearch — pull request #5975 by jpountz (2014-04-29 10:11:59+00:00)
Title: Improve the way sub-aggregations are collected.

Sub-aggregations are currently collected directly, by just forwarding the
doc ID and bucket ordinal to them. This change adds the new BucketCollector
abstract class that Aggregator extends, so that we have more flexibility to
add implicit filters or buffering between an aggregator and its sub
aggregators.