sort autocomplete by score + show score

This commit is contained in:
Daku
2016-06-18 13:18:59 +01:00
parent 4bd9ee1c7f
commit 2546621c59
2 changed files with 10 additions and 4 deletions

View File

@ -20,8 +20,14 @@ class AutoComplete extends Extension {
$SQLarr['limit'] = $_GET["limit"];
}
$res = $database->get_col(
"SELECT tag FROM tags WHERE tag LIKE :search AND count > 0 $limitSQL", $SQLarr);
$res = $database->get_pairs("
SELECT tag, count
FROM tags
WHERE tag LIKE :search
AND count > 0
ORDER BY count DESC
$limitSQL", $SQLarr
);
$page->set_mode("data");
$page->set_type("application/json");