diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2016-02-03 20:03:35 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2016-02-03 20:03:35 +0100 |
| commit | fab8cabe19ac99e3c8a95abcea3c0569b67045bb (patch) | |
| tree | 9509ba8528ae8a539f78be29199442f4fdb559d5 /www/index.php | |
| parent | e5c7780adb59e8038a040a1e534a4cee1fac8cd8 (diff) | |
| download | phinde-fab8cabe19ac99e3c8a95abcea3c0569b67045bb.tar.gz phinde-fab8cabe19ac99e3c8a95abcea3c0569b67045bb.zip | |
show elasticsearch query time
Diffstat (limited to 'www/index.php')
| -rw-r--r-- | www/index.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/www/index.php b/www/index.php index 257ad87..498cf93 100644 --- a/www/index.php +++ b/www/index.php @@ -54,8 +54,10 @@ function buildLink($baseLink, $filters, $addFilterType, $addFilterValue) return $baseLink; } +$timeBegin = microtime(true); $es = new Elasticsearch($GLOBALS['phinde']['elasticsearch']); $res = $es->search($query, $filters, $page, $perPage); +$timeEnd = microtime(true); $pager = new Html_Pager( $res->hits->total, $perPage, $page + 1, @@ -84,6 +86,7 @@ foreach ($res->aggregations as $key => &$aggregation) { render( 'search', array( + 'queryTime' => round($timeEnd - $timeBegin, 2) . 'ms', 'query' => $query, 'hitcount' => $res->hits->total, 'hits' => $res->hits->hits, |
