Bug 12478: reinstate zebra compatibility for auth search
authorRobin Sheat <robin@catalyst.net.nz>
Tue, 17 Mar 2015 04:23:56 +0000 (17:23 +1300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 26 Apr 2016 12:56:55 +0000 (09:56 -0300)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Koha/SearchEngine/Zebra/Search.pm

index 535b428..2e4aad3 100644 (file)
@@ -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;