4 class Elasticsearch_Request extends \HTTP_Request2
6 public $allow404 = false;
10 $res = parent::send();
11 $mainCode = intval($res->getStatus() / 100);
12 if ($mainCode === 2) {
16 if ($this->allow404 && $res->getStatus() == 404) {
19 $js = json_decode($res->getBody());
20 if (isset($js->error)) {
21 $error = json_encode($js->error);
23 $error = $res->getBody();
27 'Error in elasticsearch communication at '
28 . $this->getMethod() . ' ' . (string) $this->getUrl()
29 . ' (status code ' . $res->getStatus() . '): '