From dc63f75605576ec3cd07ad3d4d7c49698414aff4 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Tue, 17 Mar 2015 17:23:56 +1300 Subject: [PATCH] Bug 12478: reinstate zebra compatibility for auth search Signed-off-by: Nick Clemens Signed-off-by: Jesse Weaver Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- Koha/SearchEngine/Zebra/Search.pm | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Koha/SearchEngine/Zebra/Search.pm b/Koha/SearchEngine/Zebra/Search.pm index 535b4286bf..2e4aad36fb 100644 --- a/Koha/SearchEngine/Zebra/Search.pm +++ b/Koha/SearchEngine/Zebra/Search.pm @@ -22,21 +22,9 @@ package Koha::SearchEngine::Zebra::Search; #with 'Koha::SearchEngine::SearchRole'; use base qw(Class::Accessor); -# Removed because it doesn't exist/doesn't work. -#use Data::SearchEngine::Zebra; -#use Data::SearchEngine::Query; -#use Koha::SearchEngine::Zebra; -#use Data::Dump qw(dump); use C4::Search; # :( - -# Broken without the Data:: stuff -#has searchengine => ( -# is => 'rw', -# isa => 'Koha::SearchEngine::Zebra', -# default => sub { Koha::SearchEngine::Zebra->new }, -# lazy => 1 -#); +use C4::AuthoritiesMarc; sub search { my ($self,$query_string) = @_; @@ -71,6 +59,21 @@ sub search_compat { return getRecords(@_); } -sub dosmth {'bou' } +=head search_auth_compat + +This passes the search query on to C4::AuthoritiesMarc::SearchAuthorities + +=cut + +sub search_auth_compat { + my ( $self, $q, $startfrom, $resperpage ) = @_; + + my @params = ( + @{$q}{ marclist, and_or, excluding, operator, value }, + $startfrom - 1, + $resperpage, @{$q}{ authtypecode, orderby } + ); + C4::AuthoritiesMarc::SearchAuthorities(@params); +} 1; -- 2.39.5