Bugzilla – Attachment 164957 Details for
Bug 33407
With ES and QueryAutoTruncate on, a search containing ISBD punctuation returns no results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33407: With ES and QueryAutoTruncate on, a search containing ISBD punctuation returns no results
Bug-33407-With-ES-and-QueryAutoTruncate-on-a-searc.patch (text/plain), 2.08 KB, created by
Roman Dolny
on 2024-04-16 16:18:41 UTC
(
hide
)
Description:
Bug 33407: With ES and QueryAutoTruncate on, a search containing ISBD punctuation returns no results
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-04-16 16:18:41 UTC
Size:
2.08 KB
patch
obsolete
>From 12d082506d084ad530ef27ded3c3d6087c1776f0 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 4 Apr 2023 16:42:02 +0200 >Subject: [PATCH] Bug 33407: With ES and QueryAutoTruncate on, a search > containing ISBD punctuation returns no results > >With ES and QueryAutoTruncate on, a search with punctuation surrounded >by spaces (like ISBD punctuation copied from other catalogue or >bibliography) returns no results. E.g.: in a search for "Maria Stuart ; >Die Jungfrau von Orleans / Schiller" (coded in record as 245 10 $a Maria >Stuart ; $b Die Jungfrau von Orleans / $c Schiller) -- both semicolon >and slash cause problems. One had to remove them manually to get >results which is not what is desired. > >Test plan >========= >1. Use ktd with Elasticsearch and ktd's test data > (http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=1): >2. Make a search for the first ISBD zone taken verbatim from the first record: > E Street shuffle : the glory days of Bruce Springsteen & the E Street Band / Clinton Heylin > > There should be no result. >3. Apply teh patch, restart plack. >4. Repeat the search. You should get the record (and onother one). > >Sponsored-by: Ignatianum University in Cracow >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index edde18cc09..2c5e464cd2 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -1024,6 +1024,10 @@ sub clean_search_term { > # screen all brackets with backslash > $term =~ s/(?<!\\)(?:[\\]{2})*([\{\}\[\]])$lookahead/\\$1/g; > >+ # remove problematic punctuation and escaped slashes surrounded by spaces if truncate >+ $term =~ s/\s+(\s*[&;,:\.=\-\/]|(\\\/)\s*)+\s$lookahead/ /g if $truncate; >+ >+ > # restore all regex contents after escaping brackets: > for (my $i = 0; $i < @saved_regexes; $i++) { > $term =~ s/~~RE$i~~/$saved_regexes[$i]/; >-- >2.39.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 33407
:
164633
|
164634
|
164957
|
164958
|
167410
|
167419
|
167420
|
167649