Koha/search-test.pl
rangi 3d5d00b463 Little test set up that lets you type cql in which is passed to zebra
install search-test.pl on your opac (or the intranet, if intranet youll need to put the tmpl file in the intranet too)


NOT FOR PRODUCTION, purely for testing
2006-02-16 20:51:07 +00:00

42 lines
847 B
Perl
Executable file

#!/usr/bin/perl
# simple script to test cql searching
# written by chris@katipo.co.nz 17/2/06
use C4::Search;
use C4::Auth;
use C4::Interface::CGI::Output;
use CGI;
use Smart::Comments;
use strict;
use warnings;
my $input = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "search-test.tmpl",
type => "opac",
query => $input,
authnotrequired => 1,
flagsrequired => { borrow => 1 },
}
);
my $cql=$input->param('cql');
if ($cql){
my %search;
$search{'cql'} = $cql;
my $results = search( \%search, 'CQL' , 10);
$template->param(CQL => 'yes'
);
$template->param(results => $results);
}
#my $record = get_record($result);
output_html_with_http_headers $input, $cookie, $template->output;