From 578f1f20753df078fd7e47edb7453ba82d39c324 Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 23 Dec 2016 12:43:49 +0100 Subject: [PATCH] added paging support for folder: search Change-Id: I131acec1cd71d42ba9068eaea9293706c2971a96 Signed-off-by: SJ --- webui/model/search/search.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 2e3078fc..ea3df423 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -227,7 +227,9 @@ class ModelSearchSearch extends Model { $folder_id = $folders[$data['folder']]; } - $query = $this->sphx->query("SELECT id FROM " . SPHINX_FOLDER_INDEX . " WHERE folder_id=$folder_id $sortorder LIMIT 0,$pagelen OPTION max_matches=" . MAX_SEARCH_HITS); + $query = $this->sphx->query("SELECT id FROM " . SPHINX_FOLDER_INDEX . " WHERE folder_id=$folder_id $sortorder LIMIT $offset,$pagelen OPTION max_matches=" . MAX_SEARCH_HITS); + $total_found = $query->total_found; + $num_rows = $query->num_rows; } else if(isset($data['tag']) && $data['tag']) { list ($total_found, $num_rows, $id_list) = $this->get_sphinx_id_list($data['tag'], SPHINX_TAG_INDEX, 'tag', $page);