diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2016-11-11 20:54:12 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2016-11-11 20:54:12 +0100 |
| commit | 08fc60226f224de87d665aa7c55b6eaa9f66d768 (patch) | |
| tree | 2dee8eb122a167a84e9fcb1840cdc88eb012497c /src/phinde/Elasticsearch.php | |
| parent | 696fcd7ce4d495e356667019493bf312e2a6e47b (diff) | |
| download | phinde-08fc60226f224de87d665aa7c55b6eaa9f66d768.tar.gz phinde-08fc60226f224de87d665aa7c55b6eaa9f66d768.zip | |
status page
Diffstat (limited to 'src/phinde/Elasticsearch.php')
| -rw-r--r-- | src/phinde/Elasticsearch.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/phinde/Elasticsearch.php b/src/phinde/Elasticsearch.php index 9babfee..069cf1f 100644 --- a/src/phinde/Elasticsearch.php +++ b/src/phinde/Elasticsearch.php @@ -58,6 +58,16 @@ class Elasticsearch $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)) { |
