summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Chars/List.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-11-19 13:33:19 +0100
committerYorhel <git@yorhel.nl>2021-11-19 13:33:19 +0100
commit0a98d9df12cfc6ea73729b0b3feb3fee52c9f336 (patch)
tree777d2b1fd12a7f98825c0c2fef6ff87650867e14 /lib/VNWeb/Chars/List.pm
parent6560748025427a7bca6d074a4858a79a7e7ec48c (diff)
Search adjustments + use new search for producers,staff,characters too
Diffstat (limited to 'lib/VNWeb/Chars/List.pm')
-rw-r--r--lib/VNWeb/Chars/List.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/VNWeb/Chars/List.pm b/lib/VNWeb/Chars/List.pm
index e4956ff7..e44e77ea 100644
--- a/lib/VNWeb/Chars/List.pm
+++ b/lib/VNWeb/Chars/List.pm
@@ -106,13 +106,9 @@ TUWF::get qr{/c(?:/(?<char>all|[a-z0]))?}, sub {
$opt->{f} = advsearch_default 'c' if !$opt->{f}{query} && !defined tuwf->reqGet('f');
- my @search = map {
- my $l = '%'.sql_like($_).'%';
- length $_ > 0 ? sql '(c.name ILIKE', \$l, "OR translate(c.original,' ','') ILIKE", \$l, "OR translate(c.alias,' ','') ILIKE", \$l, ')' : ();
- } split /[ -,._]/, $opt->{q}||'';
-
my $where = sql_and
- 'NOT c.hidden', $opt->{f}->sql_where(), @search,
+ 'NOT c.hidden', $opt->{f}->sql_where(),
+ $opt->{q} ? sql 'c.c_search LIKE ALL (search_query(', \$opt->{q}, '))' : (),
defined($opt->{ch}) && $opt->{ch} ? sql('LOWER(SUBSTR(c.name, 1, 1)) =', \$opt->{ch}) : (),
defined($opt->{ch}) && !$opt->{ch} ? sql('(ASCII(c.name) <', \97, 'OR ASCII(c.name) >', \122, ') AND (ASCII(c.name) <', \65, 'OR ASCII(c.name) >', \90, ')') : ();