Elastica\ResultSet::getAggregation PHP Method

getAggregation() public method

Retrieve a specific aggregation from this result set.
public getAggregation ( string $name ) : array
$name string the name of the desired aggregation
return array
    public function getAggregation($name)
    {
        $data = $this->_response->getData();
        if (isset($data['aggregations']) && isset($data['aggregations'][$name])) {
            return $data['aggregations'][$name];
        }
        throw new InvalidException("This result set does not contain an aggregation named {$name}.");
    }