added paging support for folder: search

Change-Id: I131acec1cd71d42ba9068eaea9293706c2971a96
Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
SJ 2016-12-23 12:43:49 +01:00
parent 846acd9b6f
commit 578f1f2075

View File

@ -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);