Bugzilla – Attachment 72090 Details for
Bug 20273
Elasticsearch: Auth-finder.pl autocomplete must use search_auth_compat
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20273 - Use compat routines for autocomplete in auth_finder.pl
Bug-20273---Use-compat-routines-for-autocomplete-i.patch (text/plain), 1.92 KB, created by
Alex Arnaud
on 2018-02-22 15:39:20 UTC
(
hide
)
Description:
Bug 20273 - Use compat routines for autocomplete in auth_finder.pl
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2018-02-22 15:39:20 UTC
Size:
1.92 KB
patch
obsolete
>From 50612502a52c49c84a0d5787579e0e9d97936c5b Mon Sep 17 00:00:00 2001 >From: Koha User <support@biblibre.com> >Date: Thu, 22 Feb 2018 15:35:11 +0000 >Subject: [PATCH] Bug 20273 - Use compat routines for autocomplete in > auth_finder.pl > >Test plan: > - Context: Koha working with elasticsearch, > - Apply BZ 19582 (that make auth_finder.pl works again), > - apply this patch, > - go to cgi-bin/koha/authorities/auth_finder.pl, > - type at least 3 chararcters in a search field and > check that the autocomplete returns results >--- > authorities/ysearch.pl | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >diff --git a/authorities/ysearch.pl b/authorities/ysearch.pl >index 4a5ae79..9861f87 100755 >--- a/authorities/ysearch.pl >+++ b/authorities/ysearch.pl >@@ -33,9 +33,10 @@ use JSON; > > use C4::Context; > use C4::Charset; >-use C4::AuthoritiesMarc; > use C4::Auth qw/check_cookie_auth/; > use C4::Output; >+use Koha::SearchEngine::Search; >+use Koha::SearchEngine::QueryBuilder; > > my $query = new CGI; > >@@ -60,7 +61,18 @@ if ( $auth_status ne "ok" ) { > my $resultsperpage = 50; > my $startfrom = 0; > >- my ( $results, $total ) = SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value, $startfrom * $resultsperpage, $resultsperpage, $authtypecode, $orderby ); >+ 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 ) = >+ $searcher->search_auth_compat( $search_query, $offset, >+ $resultsperpage ); > > my %used_summaries; # hash to avoid duplicates > my @summaries; >-- >2.7.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 20273
:
72090
|
73307
|
74996
|
74997
|
74998
|
74999
|
75000
|
75001
|
77090
|
77091