[autocomplete] default to returning 1000 results from the server instead of all of them
This commit is contained in:
parent
8007ed8532
commit
4c5af15a88
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ class AutoComplete extends Extension
|
||||||
global $page;
|
global $page;
|
||||||
|
|
||||||
if ($event->page_matches("api/internal/autocomplete")) {
|
if ($event->page_matches("api/internal/autocomplete")) {
|
||||||
$limit = (int)($_GET["limit"] ?? 0);
|
$limit = (int)($_GET["limit"] ?? 1000);
|
||||||
$s = $_GET["s"] ?? "";
|
$s = $_GET["s"] ?? "";
|
||||||
|
|
||||||
$res = $this->complete($s, $limit);
|
$res = $this->complete($s, $limit);
|
||||||
|
@ -46,7 +46,7 @@ class AutoComplete extends Extension
|
||||||
}
|
}
|
||||||
|
|
||||||
# memcache keys can't contain spaces
|
# memcache keys can't contain spaces
|
||||||
$cache_key = "autocomplete:" . md5($search);
|
$cache_key = "autocomplete:$limit:" . md5($search);
|
||||||
$limitSQL = "";
|
$limitSQL = "";
|
||||||
$search = str_replace('_', '\_', $search);
|
$search = str_replace('_', '\_', $search);
|
||||||
$search = str_replace('%', '\%', $search);
|
$search = str_replace('%', '\%', $search);
|
||||||
|
|
Reference in a new issue