git.cweiske.de
/
phinde.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
status page
[phinde.git]
/
src
/
phinde
/
Elasticsearch.php
diff --git
a/src/phinde/Elasticsearch.php
b/src/phinde/Elasticsearch.php
index 9babfee21324988fbde6ac0f88e7b763d570594b..069cf1fefd74b495ea3a7aa6b4d11da8bf242a45 100644
(file)
--- a/
src/phinde/Elasticsearch.php
+++ b/
src/phinde/Elasticsearch.php
@@
-58,6
+58,16
@@
class Elasticsearch
$r->send();
}
$r->send();
}
+ public function countDocuments()
+ {
+ $r = new Elasticsearch_Request(
+ $this->baseUrl . 'document/_count',
+ \HTTP_Request2::METHOD_GET
+ );
+ $res = $r->send();
+ return json_decode($res->getBody())->count;
+ }
+
public function search($query, $filters, $site, $page, $perPage, $sort)
{
if (preg_match_all('#nick:([^ ]*)#', $query, $matches)) {
public function search($query, $filters, $site, $page, $perPage, $sort)
{
if (preg_match_all('#nick:([^ ]*)#', $query, $matches)) {