public function aggregation(Aggregation $aggregation) { $this->query['body']['aggs'][$aggregation->getName()] = $aggregation->make(); return $this; }