public function addAggregation(AbstractAggregation $aggregation)
{
if ($aggregation instanceof GlobalAggregation) {
throw new InvalidException('Global aggregators can only be placed as top level aggregators');
}
$this->_aggs[] = $aggregation;
return $this;
}