Bugzilla – Attachment 121572 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.46 KB, created by
Katrin Fischer
on 2021-06-03 10:28:03 UTC
(
hide
)
Description:
Bug 25900: trim spaces in search with Zebra and QueryWeightFields
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-06-03 10:28:03 UTC
Size:
1.46 KB
patch
obsolete
>From 397e2444715c2e8a90bb73d9296e1b714aeedbaa 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 > >Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Search.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 0db460a808..92fc89cee9 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -883,6 +883,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.11.0
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