Bug 7518: certain searches with quotation marks don't work
Under certain circumstance, a search term without quotation marks returns the expected results while the same search with a double quote embedded in it would fail. Koha should ignore the quotation marks and return results anyway. This appears when QueryWeightFields syspref is activated (and QueryAutoTruncate is off), as field weighting builds 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 QueryAutoTruncate off (you may also need to set QueryFuzzy to off) - 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 <koha.aixmarseille@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com> (cherry picked from commit868855df4b) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commitf1bb46172b) Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
e3bf3e4521
commit
87079a0aa1
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue