From eaa3bdb7ffce4ccde83d72e11dbe75327985f220 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Mon, 15 Jun 2015 15:12:39 +1200 Subject: [PATCH] Bug 12478: starting authority search in staff client Signed-off-by: Nick Clemens Signed-off-by: Jesse Weaver Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- authorities/authorities-home.pl | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index b0c4570306..53e1fa492f 100755 --- a/authorities/authorities-home.pl +++ b/authorities/authorities-home.pl @@ -77,13 +77,24 @@ if ( $op eq "do_search" ) { my $startfrom = $query->param('startfrom') || 1; my $resultsperpage = $query->param('resultsperpage') || 20; - my ( $results, $total ) = SearchAuthorities( - [$marclist], [$and_or], - [$excluding], [$operator], - [$value], ( $startfrom - 1 ) * $resultsperpage, - $resultsperpage, $authtypecode, - $orderby + my $builder = Koha::SearchEngine::QueryBuilder->new(); + my $searcher = Koha::SearchEngine::Search->new({index => 'authorities'}); + my $search_query = $builder->build_authorities_query_compat( + [$marclist], [$and_or], [$excluding], [$operator], + [$value], $authtypecode, $orderby ); + $startfrom = $startfrom // 0; + my ( $results, $total ) = + $searcher->search_auth_compat( $search_query, $startfrom + 1, + $resultsperpage ); + + #my ( $results, $total ) = SearchAuthorities( + # [$marclist], [$and_or], + # [$excluding], [$operator], + # [$value], ( $startfrom - 1 ) * $resultsperpage, + # $resultsperpage, $authtypecode, + # $orderby + #); ( $template, $loggedinuser, $cookie ) = get_template_and_user( -- 2.39.5