public function create(array $rawAggregation)
{
$aggregations = $this->preprocessAggregations($rawAggregation);
return parent::create($aggregations);
}
/** * Build buckets from raw search response. * * @param array $searchResponse Engine raw search response. * @param AggregationFactory $aggregationFactory Aggregation factory. * * @return void */ private function prepareAggregations(array $searchResponse, AggregationFactory $aggregationFactory) { $aggregations = []; if (isset($searchResponse['aggregations'])) { $aggregations = $searchResponse['aggregations']; } $this->aggregations = $aggregationFactory->create($aggregations); }