Bugzilla – Attachment 66583 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]
Change hardcoded instances of lower case "or" in search queries to be compatible with ElasticSearch query syntax
Change-hardcoded-instances-of-lower-case-or-in-sea.patch (text/plain), 2.33 KB, created by
David Gustafsson
on 2017-08-29 13:45:40 UTC
(
hide
)
Description:
Change hardcoded instances of lower case "or" in search queries to be compatible with ElasticSearch query syntax
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2017-08-29 13:45:40 UTC
Size:
2.33 KB
patch
obsolete
>From 847830227b8d6e325713130b00d8016a0fc4763f 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] Change hardcoded instances of lower case "or" in search > queries to be compatible with ElasticSearch query syntax > >https://bugs.koha-community.org/show_bug.cgi?id=19197 >--- > 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 aaead2f492..91ee24532c 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -657,7 +657,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 7a8cf126dd..87849fdf06 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -401,7 +401,7 @@ my %is_nolimit = map { $_ => 1 } @nolimits; > if($params->{'multibranchlimit'}) { > my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); > my @libraries = $library_category->libraries; >- my $multibranch = '('.join( " or ", map { 'branch: ' . $_->id } @libraries ) .')'; >+ my $multibranch = '('.join( " OR ", map { 'branch: ' . $_->id } @libraries ) .')'; > push @limits, $multibranch if ($multibranch ne '()'); > } > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index c10e95890c..d51e9590f4 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -493,7 +493,7 @@ if (@searchCategories > 0) { > if($params->{'multibranchlimit'}) { > my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); > my @libraries = $library_category->libraries; >- my $multibranch = '('.join( " or ", map { 'branch: ' . $_->id } @libraries ) .')'; >+ my $multibranch = '('.join( " OR ", map { 'branch: ' . $_->id } @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