From d794c7df62ada119c2c9dade47275769fad78c78 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 --- C4/Search.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Search.pm b/C4/Search.pm index 50f7d2b..b1a6866 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -828,6 +828,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; my $weighted_query .= "(rk=("; # Specifies that we're applying rank -- 1.7.10.4