micro optimization for "exists" ES queries
authorChristian Weiske <cweiske@cweiske.de>
Thu, 1 Sep 2016 18:36:23 +0000 (20:36 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 1 Sep 2016 18:36:23 +0000 (20:36 +0200)
src/phinde/Elasticsearch.php

index c437036..43ef4f9 100644 (file)
@@ -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)