mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Use keyword search by default
Change the default search mode such that packages that contain all of the space-separated search terms are returned. For example, the query image edit "command line" returns all packages where "image", "edit" and "command line" occurs in the package name or description. This is much more convenient and general than a simple substring search (one can still perform a substring search by quoting the whole search term). Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
913367606e
commit
20b838a90c
1 changed files with 5 additions and 3 deletions
|
@ -601,9 +601,11 @@ function pkg_search_page($SID="") {
|
|||
}
|
||||
else {
|
||||
/* Search by name and description (default). */
|
||||
$K = "%" . addcslashes($_GET['K'], '%_') . "%";
|
||||
$q_where .= "AND (Packages.Name LIKE " . $dbh->quote($K) . " OR ";
|
||||
$q_where .= "Description LIKE " . $dbh->quote($K) . ") ";
|
||||
foreach (str_getcsv($_GET['K'], ' ') as $term) {
|
||||
$term = "%" . addcslashes($term, '%_') . "%";
|
||||
$q_where .= "AND (Packages.Name LIKE " . $dbh->quote($term) . " OR ";
|
||||
$q_where .= "Description LIKE " . $dbh->quote($term) . ") ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue