3 # Copyright 2000-2006 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
27 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
29 # set the version for version checking
30 $VERSION = do { my @v = '$Revision$' =~ /\d+/g;
31 shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
35 C4::Search - Functions for searching the Koha catalog and other databases
43 This module provides the searching facilities for the Koha catalog and
54 # make all your functions, whether exported or not;
57 my ($search,$type)=@_;
59 my $host=C4::Context->config("zebraserver");
60 my $port=C4::Context->config("zebraport");
61 my $intranetdir=C4::Context->config("intranetdir");
64 $Zconn = new ZOOM::Connection($host,$port);
67 warn "Error ", $@->code(), ": ", $@->message(), "\n";
72 foreach my $var (keys %$search) {
73 $string.="$var=\"$search->{$var}\" ";
75 $Zconn->option(cqlfile => "$intranetdir/zebra/pqf.properties");
76 $Zconn->option(preferredRecordSyntax => "xml");
77 $q = new ZOOM::Query::CQL2RPN( $string, $Zconn);
80 my $rs = $Zconn->search($q);
82 ###$rs->record(0)->render();
85 print "Error ", $@->code(), ": ", $@->message(), "\n";
95 Koha Developement team <info@koha.org>