summaryrefslogtreecommitdiff
path: root/lib/Multi
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/Multi
parent6560748025427a7bca6d074a4858a79a7e7ec48c (diff)
Search adjustments + use new search for producers,staff,characters too
Diffstat (limited to 'lib/Multi')
-rw-r--r--lib/Multi/API.pm6
-rw-r--r--lib/Multi/IRC.pm4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index 866de1ce..24a8a0ee 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -817,7 +817,7 @@ my %GET_PRODUCER = (
[ stra => 'p.lang :op:(:value:)', {'=' => 'IN', '!=' => 'NOT IN'}, join => ',', process => \'lang' ],
],
search => [
- [ str => '(p.name ILIKE :value: OR p.original ILIKE :value: OR p.alias ILIKE :value:)', {'~',1}, process => \'like' ],
+ [ str => 'p.c_search LIKE ALL (search_query(:value:))', {'~',1} ],
],
},
);
@@ -928,7 +928,7 @@ my %GET_CHARACTER = (
[ str => 'c.original ILIKE :value:', {'~',1}, process => \'like' ]
],
search => [
- [ str => '(c.name ILIKE :value: OR c.original ILIKE :value: OR c.alias ILIKE :value:)', {'~',1}, process => \'like' ],
+ [ str => 'c.c_search LIKE ALL (search_query(:value:))', {'~',1} ],
],
vn => [
[ 'int' => 'c.id IN(SELECT cv.id FROM chars_vns cv WHERE cv.vid = :value:)', {'=',1}, process => \'v' ],
@@ -1033,7 +1033,7 @@ my %GET_STAFF = (
[ inta => 's.id IN(SELECT sa.id FROM staff_alias sa WHERE sa.aid IN(:value:))', {'=',1}, range => [1,1e6], join => ',' ],
],
search => [
- [ str => 's.id IN(SELECT sa.id FROM staff_alias sa WHERE sa.name ILIKE :value: OR sa.original ILIKE :value:)', {'~',1}, process => \'like' ],
+ [ str => 's.id IN(SELECT sa.id FROM staff_alias sa WHERE sa.c_search LIKE ALL (search_query(:value:)))', {'~',1} ],
],
},
);
diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm
index 245603a2..4ef26ec1 100644
--- a/lib/Multi/IRC.pm
+++ b/lib/Multi/IRC.pm
@@ -393,10 +393,10 @@ p => [ 0, 0, sub {
pg_cmd q{
SELECT id, name AS title
FROM producers p
- WHERE hidden = FALSE AND (name ILIKE $1 OR original ILIKE $1 OR alias ILIKE $1)
+ WHERE hidden = FALSE AND c_search LIKE ALL (search_query($1))
ORDER BY name
LIMIT 6
- }, [ "%$q%" ], sub {
+ }, [ $q ], sub {
my $res = shift;
return if pg_expect $res, 1;
return $irc->send_msg(PRIVMSG => $chan, 'No producers novels found.') if !$res->nRows;