Bugzilla – Attachment 80688 Details for
Bug 19197
Lower case "or" results in broken ElasticSearch queries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19197: Change lower case "or" to upper case
Bug-19197-Change-lower-case-or-to-upper-case.patch (text/plain), 2.31 KB, created by
Mark Tompsett
on 2018-10-17 02:42:47 UTC
(
hide
)
Description:
Bug 19197: Change lower case "or" to upper case
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-10-17 02:42:47 UTC
Size:
2.31 KB
patch
obsolete
>From f9bd5d3e9c4a2895e3a51e4148caf8b259f63cdb Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Tue, 29 Aug 2017 15:44:35 +0200 >Subject: [PATCH] Bug 19197: Change lower case "or" to upper case > >This makes the search queries compatible with ElasticSearch query syntax >--- > C4/Matcher.pm | 2 +- > catalogue/search.pl | 2 +- > opac/opac-search.pl | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 5a62c055e4..703651a362 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -659,7 +659,7 @@ sub get_matches { > } > else { > my $phr = ( C4::Context->preference('AggressiveMatchOnISBN') || C4::Context->preference('AggressiveMatchOnISSN') ) ? ',phr' : q{}; >- $query = join( " or ", >+ $query = join( " OR ", > map { "$matchpoint->{'index'}$phr=\"$_\"" } @source_keys ); > #NOTE: double-quote the values so you don't get a "Embedded truncation not supported" error when a term has a ? in it. > } >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 842ada5f7e..8d0954929c 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -399,7 +399,7 @@ my %is_nolimit = map { $_ => 1 } @nolimits; > if($params->{'multibranchlimit'}) { > my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); > my @libraries = $search_group->all_libraries; >- my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; >+ my $multibranch = '('.join( " OR ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; > push @limits, $multibranch if ($multibranch ne '()'); > } > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 7aaffef1e5..0fe89b2875 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -494,7 +494,7 @@ if (@searchCategories > 0) { > if($params->{'multibranchlimit'}) { > my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); > my @libraries = $search_group->all_libraries; >- my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; >+ my $multibranch = '('.join( " OR ", map { 'branch: ' . $_->branchcode } @libraries ) .')'; > push @limits, $multibranch if ($multibranch ne '()'); > } > >-- >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 19197
:
66583
|
75114
|
80688
|
92607