protected function _request($path, $method = 'GET', $data = null, $headers = array())
{
try {
$result = $this->_httpClient->request($method, $this->_server . $path, $data, $headers);
return json_decode($result->getBody());
} catch (Horde_Http_Exception $e) {
throw new Horde_ElasticSearch_Exception($e->getMessage(), $e->getCode(), $e);
}
}