git.cweiske.de
/
phinde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b054d1
)
micro optimization for "exists" ES queries
author
Christian Weiske
<
[email protected]
>
Thu, 1 Sep 2016 18:36:23 +0000
(20:36 +0200)
committer
Christian Weiske
<
[email protected]
>
Thu, 1 Sep 2016 18:36:23 +0000
(20:36 +0200)
src/phinde/Elasticsearch.php
patch
|
blob
|
history
diff --git
a/src/phinde/Elasticsearch.php
b/src/phinde/Elasticsearch.php
index c437036794c1724d19e444c12b1fd1b8802ebc4a..43ef4f9eda3ca9123b419978770a40f58a54bd4d 100644
(file)
--- 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)