1 # $Id: CQL.pm,v 1.1 2007-05-01 15:32:16 mike Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Search::CQL;
11 use ZOOM::IRSpy::Test;
12 our @ISA = qw(ZOOM::IRSpy::Test);
19 ### More indexes could be added here
20 my @indexes = qw(cql.serverChoice cql.anywhere cql.allRecords
23 dc.title dc.creator dc.description
24 zeerex.numberOfRecords zeerex.set
27 foreach my $index (@indexes) {
28 $conn->irspy_search(cql => "$index=mineral",
29 { index => $index }, {},
30 ZOOM::Event::ZEND, \&found,
31 exception => \&error);
37 my($conn, $task, $udata, $event) = @_;
38 my $index = $udata->{"index"};
40 my $n = $task->{rs}->size();
41 $task->{rs}->destroy();
42 $conn->log("irspy_test",
43 "CQL search on '$index' found $n record", $n==1 ? "" : "s");
44 $conn->record()->store_result("search_cql", index => $index, ok => 1);
45 return ZOOM::IRSpy::Status::TASK_DONE;
50 my($conn, $task, $udata, $exception) = @_;
51 my $index = $udata->{"index"};
53 $task->{rs}->destroy();
54 $conn->log("irspy_test", "CQL search on '$index' had error: $exception");
55 $conn->record()->store_result("search_cql", index => $index, ok => 0);
56 return ZOOM::IRSpy::Status::TEST_BAD
57 if $exception->code() == 11; # Unsupported query type
59 return ZOOM::IRSpy::Status::TASK_DONE;