From 30ab2f9ef7e8becf9490843f25b2580fc3bce3a5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 7 Jan 2023 12:18:30 +0100 Subject: [PATCH] limit can be passed by url parameter, add '*' to query in typeahead mode --- out/out.Search.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/out/out.Search.php b/out/out.Search.php index 599004dd6..c28388f2e 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -66,11 +66,14 @@ if (isset($_GET["removecategory"]) && is_numeric($_GET["removecategory"]) && $_G $removecategory = (int) $_GET['removecategory']; } +$limit = (isset($_GET["limit"]) && is_numeric($_GET["limit"])) ? (int) $_GET['limit'] : 20; $fullsearch = ((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext') || !empty($_GET["fullsearch"])) && $settings->_enableFullSearch; if($fullsearch) { // Search in Fulltext {{{ if (isset($_GET["query"]) && is_string($_GET["query"])) { $query = $_GET["query"]; + if($_GET['action'] == 'typeahead') + $query .= '*'; } else { $query = ""; @@ -183,7 +186,7 @@ if($fullsearch) { $searchTime = 0; } else { $startTime = getTime(); - $limit = 20; +// $limit = 20; $total = 0; $index = $fulltextservice->Indexer(); if($index) { @@ -471,7 +474,7 @@ if($fullsearch) { // // Default page to display is always one. $pageNumber=1; - $limit = 15; +// $limit = 15; if (isset($_GET["pg"])) { if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) { $pageNumber = (int) $_GET["pg"];