Bugzilla – Attachment 92607 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: Fix multibranch limits in ElasticSearch
Bug-19197-Fix-multibranch-limits-in-ElasticSearch.patch (text/plain), 2.29 KB, created by
Nick Clemens (kidclamp)
on 2019-09-05 13:19:44 UTC
(
hide
)
Description:
Bug 19197: Fix multibranch limits in ElasticSearch
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-09-05 13:19:44 UTC
Size:
2.29 KB
patch
obsolete
>From 67de11e0fc90db5c745d394af27eab04f276bbe1 Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Thu, 5 Sep 2019 13:01:03 +0000 >Subject: [PATCH] Bug 19197: Fix multibranch limits in ElasticSearch > >Two issues here: >1 - OR must be capitalized >2 - The 'branch' is not analyzed and turned into 'homebranch' correctly. If we specify 'homebranch' we can later build in a 'holdingbranch' search too > >To test: > 1 - Go to Administration -> Library Groups > 2 - Create a search group for staff and opac > 3 - Add two libraries > 4 - Perform an advanced search, limit to the group you just created > 5 - Note the number of results > 6 - Switch SearchEngine syspref to 'Elasticsearch' > 7 - Repeat search, note it fails > 8 - Apply patch > 9 - Restart all the things >10 - Repeat the search >11 - Success! Number of results should match previous search >12 - Switch SearchEngine to 'Zebra' >13 - Repeat search >14 - Success! Search works and number of results matches >--- > catalogue/search.pl | 2 +- > opac/opac-search.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index a3a7015efc..901f0368e9 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -408,7 +408,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 { 'homebranch: ' . $_->branchcode } @libraries ) .')'; > push @limits, $multibranch if ($multibranch ne '()'); > } > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 27d1f2ce5c..660c754f5a 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -500,7 +500,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 { 'homebranch: ' . $_->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