/** * Clean aggregations if we don't need to process them * * @return void */ private function cleanAggregations() { if (!$this->aggregationStatus->isEnabled()) { $this->requestData['aggregations'] = []; } else { if (array_key_exists('aggregations', $this->requestData) && is_array($this->requestData['aggregations'])) { foreach ($this->requestData['aggregations'] as $aggregationName => $aggregationValue) { switch ($aggregationValue['type']) { case 'dynamicBucket': if (is_string($aggregationValue['method']) && preg_match('/^\\$(.+)\\$$/si', $aggregationValue['method'])) { unset($this->requestData['aggregations'][$aggregationName]); } } } } } }
/** * Clean aggregations if we don't need to process them * * @return void */ private function cleanAggregations() { if (!$this->aggregationStatus->isEnabled()) { $this->requestData['aggregations'] = []; } }