Bugzilla – Attachment 124379 Details for
Bug 28484
Elasticsearch fails to parse query if exclamation point is in 245$a
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28484: ES clean title in biblio detail
Bug-28484-ES-clean-title-in-biblio-detail.patch (text/plain), 2.12 KB, created by
Martin Renvoize (ashimema)
on 2021-09-01 15:04:42 UTC
(
hide
)
Description:
Bug 28484: ES clean title in biblio detail
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-01 15:04:42 UTC
Size:
2.12 KB
patch
obsolete
>From 9669fdd7b24fbee52fbf39e81911e2ccb50edc4b Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Thu, 22 Jul 2021 11:45:15 +0000 >Subject: [PATCH] Bug 28484: ES clean title in biblio detail > >Test plan: > - Create a biblio with title like "osteuropa:" or "osteuropa!" > - Go the this biblio detail pages (cgi-bin/koha/catalogue/detail.pl) > => Error > - Apply bug 28316 and this one > - test again > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/SearchEngine/Zebra/QueryBuilder.pm | 13 +++++++++++++ > catalogue/detail.pl | 6 ++++++ > 2 files changed, 19 insertions(+) > >diff --git a/Koha/SearchEngine/Zebra/QueryBuilder.pm b/Koha/SearchEngine/Zebra/QueryBuilder.pm >index 2fc1e1ae8e..4e8063b08e 100644 >--- a/Koha/SearchEngine/Zebra/QueryBuilder.pm >+++ b/Koha/SearchEngine/Zebra/QueryBuilder.pm >@@ -73,4 +73,17 @@ sub build_authorities_query_compat { > build_authorities_query(@_); > } > >+ >+=head2 clean_search_term >+ >+ my $term = $self->clean_search_term($term); >+ >+=cut >+ >+sub clean_search_term { >+ my ( $self, $term ) = @_; >+ >+ return $term; >+} >+ > 1; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 0cb204ced9..b5801cca71 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -55,6 +55,7 @@ use Koha::Patrons; > use Koha::Virtualshelves; > use Koha::Plugins; > use Koha::SearchEngine::Search; >+use Koha::SearchEngine::QueryBuilder; > > my $query = CGI->new(); > >@@ -128,8 +129,13 @@ my $marcflavour = C4::Context->preference("marcflavour"); > my $searcher = Koha::SearchEngine::Search->new( > { index => $Koha::SearchEngine::BIBLIOS_INDEX } > ); >+ my $builder = Koha::SearchEngine::QueryBuilder->new( >+ { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); >+ > my $cleaned_title = $biblio->title; > $cleaned_title =~ tr|/||; >+ $cleaned_title = $builder->clean_search_term($cleaned_title); >+ > my $query = > ( C4::Context->preference('UseControlNumber') and $record->field('001') ) > ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)' >-- >2.20.1
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 28484
:
123045
|
123607
|
124379
|
125433
|
125434
|
125435