Skip to content

Commit

Permalink
ElasticSearchRequest: ES1.0 no longer returns "ok" in responses
Browse files Browse the repository at this point in the history
See elastic/elasticsearch#4310

The code that checks for a 200 response code will pick up any errors.
  • Loading branch information
Matt Reishus committed Apr 29, 2014
1 parent f2022dc commit 74e8f4f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Lib/ElasticSearchRequest.php
Expand Up @@ -131,9 +131,6 @@ public function createRecord($data, $request = array()) {
$request['uri']['path'] .= '/'; // automatic ID creation
$request['body'] = $this->asJson($data);
$data = $this->request($request);
if (empty($data['ok'])) {
throw new ElasticSearchRequestException('create record exception - response not ok: ' . json_encode($data));
}
if (!empty($data['_id'])) {
return $data['_id'];
}
Expand All @@ -147,9 +144,6 @@ public function updateRecord($id, $data, $request = array()) {
$request['uri']['path'] .= "/{$id}"; // explicit id = overwrite
$request['body'] = $this->asJson($data);
$data = $this->request($request);
if (empty($data['ok'])) {
throw new ElasticSearchRequestException('update record exception - response not ok: ' . json_encode($data));
}
if (!empty($data['_id'])) {
return $data['_id'];
}
Expand Down

0 comments on commit 74e8f4f

Please sign in to comment.