summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-10-01 19:19:20 +0200
committerYorhel <git@yorhel.nl>2015-10-01 19:19:20 +0200
commit423a37af953817b59879f2d3013a44a54006ec3b (patch)
tree27c246b66a60eb1dde5ef36d9217ab556c46526b
parentb5c3aa020836541ef2e94812ab83e73de364abe4 (diff)
VN search: Add some more quote characters + & to normalization
As suggested by https://vndb.org/t2520.168
-rw-r--r--lib/VNDBUtil.pm3
-rw-r--r--util/updates/update_2.25.sql4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/VNDBUtil.pm b/lib/VNDBUtil.pm
index 7bec05b2..d65c2c3f 100644
--- a/lib/VNDBUtil.pm
+++ b/lib/VNDBUtil.pm
@@ -195,8 +195,9 @@ sub normalize {
s/\pM//g;
# remove some characters that have no significance when searching
use utf8;
- tr/\r\n\t ,_\-.~:[]()%+!?&#$"'`♥★☆♪†「」『』【】・”//d;
+ tr/\r\n\t ,_\-.~:[]()%+!?#$"'`♥★☆♪†「」『』【】・‟”‛’‘‚„«‹»›//d;
tr/@/a/;
+ s/&/and/;
# remove commonly used release titles ("x Edition" and "x Version")
# this saves some space and speeds up the search
s/(?:
diff --git a/util/updates/update_2.25.sql b/util/updates/update_2.25.sql
index 138ec7a0..07275ae7 100644
--- a/util/updates/update_2.25.sql
+++ b/util/updates/update_2.25.sql
@@ -63,3 +63,7 @@ CREATE OR REPLACE FUNCTION strip_spoilers(t text) RETURNS text AS $$
-- The website doesn't require the [spoiler] tag to be closed, the outer replace catches that case.
SELECT regexp_replace(regexp_replace(t, '\[spoiler\].*?\[/spoiler\]', ' ', 'ig'), '\[spoiler\].*', ' ', 'i');
$$ LANGUAGE sql IMMUTABLE;
+
+
+-- Changes to search normalization
+UPDATE vn SET c_search = NULL;