diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2016-09-01 20:36:23 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2016-09-01 20:36:23 +0200 |
| commit | 931c65bc8f5addd0a67764283b76b7e05104d535 (patch) | |
| tree | a54d368851fc97818cea20ef2e718ed28d9814b4 /src | |
| parent | 5b054d1fb39604419150051dd1d99dacbdeb2cba (diff) | |
| download | phinde-931c65bc8f5addd0a67764283b76b7e05104d535.tar.gz phinde-931c65bc8f5addd0a67764283b76b7e05104d535.zip | |
micro optimization for "exists" ES queries
Diffstat (limited to 'src')
| -rw-r--r-- | src/phinde/Elasticsearch.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/phinde/Elasticsearch.php b/src/phinde/Elasticsearch.php index c437036..43ef4f9 100644 --- a/src/phinde/Elasticsearch.php +++ b/src/phinde/Elasticsearch.php @@ -35,8 +35,8 @@ class Elasticsearch ) ) ); - $res = json_decode($r->send()->getBody()); - return $res->exists; + $status = $r->send()->getStatus(); + return $status !== 404; } public function get($url) |
