Commit 9f1e3658 authored by Byron Jones's avatar Byron Jones

Bug 1088086: Possible duplicate search doesn't return any results if you input "a->b" (for any a/b)

r=dylan,a=glob
parent 16009fb3
...@@ -184,15 +184,19 @@ sub sql_fulltext_search { ...@@ -184,15 +184,19 @@ sub sql_fulltext_search {
if ($text =~ /(?:^|\W)[+\-<>~"()]/ || $text =~ /[()"*](?:$|\W)/) { if ($text =~ /(?:^|\W)[+\-<>~"()]/ || $text =~ /[()"*](?:$|\W)/) {
$mode = 'IN BOOLEAN MODE'; $mode = 'IN BOOLEAN MODE';
# quote un-quoted compound words my @terms = split(quotemeta(FULLTEXT_OR), $text);
my @words = quotewords('[\s()]+', 'delimiters', $text); foreach my $term (@terms) {
foreach my $word (@words) { # quote un-quoted compound words
# match words that have non-word chars in the middle of them my @words = quotewords('[\s()]+', 'delimiters', $term);
if ($word =~ /\w\W+\w/ && $word !~ m/"/) { foreach my $word (@words) {
$word = '"' . $word . '"'; # match words that have non-word chars in the middle of them
if ($word =~ /\w\W+\w/ && $word !~ m/"/) {
$word = '"' . $word . '"';
}
} }
$term = join('', @words);
} }
$text = join('', @words); $text = join(FULLTEXT_OR, @terms);
} }
# quote the text for use in the MATCH AGAINST expression # quote the text for use in the MATCH AGAINST expression
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment