aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-09-01 20:36:23 +0200
committerChristian Weiske <cweiske@cweiske.de>2016-09-01 20:36:23 +0200
commit931c65bc8f5addd0a67764283b76b7e05104d535 (patch)
treea54d368851fc97818cea20ef2e718ed28d9814b4
parent5b054d1fb39604419150051dd1d99dacbdeb2cba (diff)
downloadphinde-931c65bc8f5addd0a67764283b76b7e05104d535.tar.gz
phinde-931c65bc8f5addd0a67764283b76b7e05104d535.zip
micro optimization for "exists" ES queries
-rw-r--r--src/phinde/Elasticsearch.php4
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)