Bugzilla – Attachment 65882 Details for
Bug 18624
Software error when searching authorities in Elasticsearch - incorrect parameter "any" should be "all"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18624: Minor refactoring to ease testing
Bug-18624-Minor-refactoring-to-ease-testing.patch (text/plain), 2.50 KB, created by
Marcel de Rooy
on 2017-08-11 09:13:25 UTC
(
hide
)
Description:
Bug 18624: Minor refactoring to ease testing
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-08-11 09:13:25 UTC
Size:
2.50 KB
patch
obsolete
>From 6bbd972aad7f09f7123f5caf5bda5809c532faa6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 7 Aug 2017 16:07:40 -0300 >Subject: [PATCH] Bug 18624: Minor refactoring to ease testing >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 27 +++++++++++++------------ > 1 file changed, 14 insertions(+), 13 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index fbd4370..2fe9236 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -47,7 +47,7 @@ use Modern::Perl; > use URI::Escape; > > use C4::Context; >-use Data::Dumper; # TODO remove >+use Koha::Exceptions; > > =head2 build_query > >@@ -409,6 +409,16 @@ appropriate search object. > > =cut > >+our $koha_to_index_name = { >+ mainmainentry => 'Heading-Main', >+ mainentry => 'Heading', >+ match => 'Match', >+ 'match-heading' => 'Match-heading', >+ 'see-from' => 'Match-heading-see-from', >+ thesaurus => 'Subject-heading-thesaurus', >+ any => '' >+}; >+ > sub build_authorities_query_compat { > my ( $self, $marclist, $and_or, $excluding, $operator, $value, > $authtypecode, $orderby ) >@@ -418,24 +428,15 @@ sub build_authorities_query_compat { > # extensible hash form that is understood by L<build_authorities_query>. > my @searches; > >- my %koha_to_index_name = ( >- mainmainentry => 'Heading-Main', >- mainentry => 'Heading', >- match => 'Match', >- 'match-heading' => 'Match-heading', >- 'see-from' => 'Match-heading-see-from', >- thesaurus => 'Subject-heading-thesaurus', >- any => '', >- ); >- > # Make sure everything exists > foreach my $m (@$marclist) { >- confess "Invalid marclist field provided: $m" unless exists $koha_to_index_name{$m}; >+ Koha::Exceptions::WrongParameter->throw("Invalid marclist field provided: $m") >+ unless exists $koha_to_index_name->{$m}; > } > for ( my $i = 0 ; $i < @$value ; $i++ ) { > push @searches, > { >- where => $koha_to_index_name{$marclist->[$i]}, >+ where => $koha_to_index_name->{$marclist->[$i]}, > operator => $operator->[$i], > value => $value->[$i], > }; >-- >2.1.4
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 18624
:
64385
|
65591
|
65592
|
65593
|
65594
| 65882 |
65883
|
65884
|
65885
|
66020