protected function parseElasticResponse($response)
{
if (!isset($response['hits']) || !isset($response['hits']['hits']) || !is_array($response['hits']['hits'])) {
throw new \Exception('The Elasticsearch client does not return expected response.');
}
return $response['hits']['hits'];
}