From 5764168f36008480fdfcfc795970b20976c7af15 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 7 Mar 2013 16:02:55 +0100 Subject: [PATCH] Bug 7518: searches with quotation marks don't work A search term without quotation marks returns the expected results. The same search term with quotation marks returns no results. Koha should ignore the quotation marks and return results anyway. This appears when QueryWeightFields syspref is activated. This feature composes a complex CCL query using double quotes around search words. This patch simply replaces double quotes in search words by a space. Test plan : - Set QueryWeightFields off - Perform a serch on two words where you have results, like : centre "ville => you get results - Set QueryWeightFields on - Perform same serch => you get the same results Signed-off-by: Leila Signed-off-by: Kyle M Hall --- C4/Search.pm | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index aec024b..8d95493 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -847,6 +847,7 @@ sub _build_weighted_query { my $stemming = C4::Context->preference("QueryStemming") || 0; my $weight_fields = C4::Context->preference("QueryWeightFields") || 0; my $fuzzy_enabled = C4::Context->preference("QueryFuzzy") || 0; + $operand =~ s/"/ /g; # Bug 7518: searches with quotation marks don't work my $weighted_query .= "(rk=("; # Specifies that we're applying rank -- 1.7.2.5