Bugzilla – Attachment 114228 Details for
Bug 25900
QueryWeightFields creates unnecessary whitespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25900: trim spaces in search with Zebra and QueryWeightFields
Bug-25900-trim-spaces-in-search-with-Zebra-and-Que.patch (text/plain), 1.35 KB, created by
Fridolin Somers
on 2020-12-07 09:19:21 UTC
(
hide
)
Description:
Bug 25900: trim spaces in search with Zebra and QueryWeightFields
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-12-07 09:19:21 UTC
Size:
1.35 KB
patch
obsolete
>From 8176df88a68811f0bbddd55b930543779e7c8f9d Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 30 Jun 2020 15:14:24 +0200 >Subject: [PATCH] Bug 25900: trim spaces in search with Zebra and > QueryWeightFields > >Search with Zebra and system preference QueryWeightFields on builds a query with surrounding double quotes : q=tree => q="tree". Therefore existing double quotes are replaced by a space : q="tree" => q=" tree ". > >Patch corrects by adding trim on operand after transforming quotes into spaces. > >Test plan : >1) Use Zebra searchengine and enable system preference QueryWeightFields >2) Go to advanced search >3) Search on two words from a title, surrounded by double quotes. Like "Order of the Phoenix" >4) Check you get same results with an without patch >--- > C4/Search.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 811e6c1809..2ab5a528d9 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -963,6 +963,7 @@ sub _build_weighted_query { > 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 >+ $operand =~ s/^\s+|\s+$//g; # Trim > > my $weighted_query .= "(rk=("; # Specifies that we're applying rank > >-- >2.29.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25900
:
106432
|
114228
|
121529
|
121572