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}.");
}