Bugzilla – Attachment 68984 Details for
Bug 19582
Elasticsearch: Auth-finder.pl must use search_auth_compat
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19582 - Use compat routines for searching authorities in auth_finder.pl
Bug-19582---Use-compat-routines-for-searching-auth.patch (text/plain), 3.57 KB, created by
Nick Clemens
on 2017-11-06 17:19:19 UTC
(
hide
)
Description:
Bug 19582 - Use compat routines for searching authorities in auth_finder.pl
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2017-11-06 17:19:19 UTC
Size:
3.57 KB
patch
obsolete
>From ad443467734ecb4ae21bf06b924a418273c70dad Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 6 Nov 2017 17:14:34 +0000 >Subject: [PATCH] Bug 19582 - Use compat routines for searching authorities in > auth_finder.pl > >To test: >1 - Enable Zebra >2 - Perform an auth search >3 - note results >4 - Enable ES >5 - Repeat search, note (likely) diff results >6 - Open a record in cataloging and use the button to launch auth search >7 - Perform same search as above, note results match for eiher engine >selected >8 - NOTE: Disbale sorting for ES search - this will be dealt with in >another report >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + > authorities/auth_finder.pl | 16 +++++++++++++--- > .../prog/en/includes/auth-finder-search.inc | 2 +- > 3 files changed, 15 insertions(+), 4 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index cdd0fc6..4f83a42 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -435,6 +435,7 @@ sub build_authorities_query_compat { > unless exists $koha_to_index_name->{$m}; > } > for ( my $i = 0 ; $i < @$value ; $i++ ) { >+ next unless $value->[$i]; > push @searches, > { > where => $koha_to_index_name->{$marclist->[$i]}, >diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl >index b484f03..4d6e61f 100755 >--- a/authorities/auth_finder.pl >+++ b/authorities/auth_finder.pl >@@ -28,6 +28,8 @@ use C4::Context; > use C4::AuthoritiesMarc; > use C4::Acquisition; > use C4::Koha; >+use Koha::SearchEngine::Search; >+use Koha::SearchEngine::QueryBuilder; > > use Koha::Authority::Types; > >@@ -69,10 +71,18 @@ if ( $op eq "do_search" ) { > my $startfrom = $query->param('startfrom') || 0; > my $resultsperpage = $query->param('resultsperpage') || 20; > >+ my $builder = Koha::SearchEngine::QueryBuilder->new( >+ { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); >+ my $searcher = Koha::SearchEngine::Search->new( >+ { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); >+ my $search_query = $builder->build_authorities_query_compat( >+ \@marclist, \@and_or, \@excluding, \@operator, >+ \@value, $authtypecode, $orderby >+ ); >+ my $offset = $startfrom * $resultsperpage; > my ( $results, $total ) = >- SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value, >- $startfrom * $resultsperpage, >- $resultsperpage, $authtypecode, $orderby ); >+ $searcher->search_auth_compat( $search_query, $offset, >+ $resultsperpage ); > > # multi page display gestion > my $displaynext = 0; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc >index 16a666e..2b28bd2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc >@@ -197,7 +197,7 @@ function finderjumpfull(page) > </li> > <li> > <label for="marclistanywhere">Search entire record: </label> >- <input type="hidden" name="marclist" value="any" /> >+ <input type="hidden" name="marclist" value="all" /> > <input type="hidden" name="and_or" value="and" /> > <input type="hidden" name="excluding" value="" /> > <select name="operator" id="marclistanywhere"> >-- >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 19582
:
68984
|
68992
|
68993
|
69031
|
69032
|
72717
|
72782
|
72783
|
72784
|
72792
|
72793
|
72794
|
72795
|
72796