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
;
26 use Koha
::SearchEngine
::Search
;
30 Koha::SearchEngine::Zebra::Search - Search implementation for Zebra
39 my ($self,$query_string) = @_;
41 my $query = Data
::SearchEngine
::Query
->new(
44 query
=> $query_string,
47 my $results = $self->searchengine->search($query);
49 foreach my $item (@
{ $results->items }) {
50 my $title = $item->get_value('ste_title');
51 #utf8::encode($title);
58 This passes straight through to C4::Search::getRecords.
63 shift; # get rid of $self
65 return getRecords
(@_);
68 =head2 simple_search_compat
70 This passes straight through to C4::Search::SimpleSearch.
75 sub simple_search_compat
{
77 return C4
::Search
::SimpleSearch
(@_);
80 =head2 extract_biblionumber
82 my $biblionumber = $searcher->extract_biblionumber( $searchresult );
84 $searchresult comes from simple_search_compat.
86 Returns the biblionumber from the search result record.
90 sub extract_biblionumber
{
91 my ( $self, $searchresultrecord ) = @_;
92 my $record = C4
::Search
::new_record_from_zebra
( 'biblioserver', $searchresultrecord );
93 return Koha
::SearchEngine
::Search
::extract_biblionumber
( $record );
96 =head2 search_auth_compat
98 This passes the search query on to C4::AuthoritiesMarc::SearchAuthorities
102 sub search_auth_compat
{
103 my ( $self, $q, $startfrom, $resperpage ) = @_;
106 @
{$q}{ 'marclist', 'and_or', 'excluding', 'operator', 'value' },
108 $resperpage, @
{$q}{ 'authtypecode', 'orderby' }
110 C4
::AuthoritiesMarc
::SearchAuthorities
(@params);