aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/search/list.htm2
-rw-r--r--www/index.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/data/templates/search/list.htm b/data/templates/search/list.htm
index 4341600..ef8d454 100644
--- a/data/templates/search/list.htm
+++ b/data/templates/search/list.htm
@@ -4,7 +4,7 @@
</p>
{% else %}
<p>
- Found {{hitcount}} search results for "<tt>{{query}}</tt>":
+ Found {{hitcount}} search results for "<tt>{{query}}</tt>" in {{queryTime}}:
</p>
<ul class="hits">
{% for hit in hits %}
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,