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 c437036794c1724d19e444c12b1fd1b8802ebc4a..43ef4f9eda3ca9123b419978770a40f58a54bd4d 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)