1 package Koha::SearchEngine::Zebra::Search;
3 # This file is part of Koha.
5 # Copyright 2012 BibLibre
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 use base qw(Class::Accessor);
25 use C4::AuthoritiesMarc;
29 Koha::SearchEngine::Zebra::Search - Search implementation for Zebra
38 my ($self,$query_string) = @_;
40 my $query = Data::SearchEngine::Query->new(
43 query => $query_string,
46 my $results = $self->searchengine->search($query);
48 foreach my $item (@{ $results->items }) {
49 my $title = $item->get_value('ste_title');
50 #utf8::encode($title);
57 This passes straight through to C4::Search::getRecords.
62 shift; # get rid of $self
64 return getRecords(@_);
67 =head2 simple_search_compat
69 This passes straight through to C4::Search::SimpleSearch.
74 sub simple_search_compat {
76 return C4::Search::SimpleSearch(@_);
79 =head2 search_auth_compat
81 This passes the search query on to C4::AuthoritiesMarc::SearchAuthorities
85 sub search_auth_compat {
86 my ( $self, $q, $startfrom, $resperpage ) = @_;
89 @{$q}{ 'marclist', 'and_or', 'excluding', 'operator', 'value' },
91 $resperpage, @{$q}{ 'authtypecode', 'orderby' }
93 C4::AuthoritiesMarc::SearchAuthorities(@params);