2 # See the "Main" test package for documentation
4 package ZOOM::IRSpy::Test::Search::CQL;
10 use ZOOM::IRSpy::Test;
11 our @ISA = qw(ZOOM::IRSpy::Test);
18 ### More indexes could be added here
19 my @indexes = qw(cql.serverChoice cql.anywhere cql.allRecords
22 dc.title dc.creator dc.description
23 zeerex.numberOfRecords zeerex.set
26 foreach my $index (@indexes) {
27 $conn->irspy_search(cql => "$index=mineral",
28 { index => $index }, {},
29 ZOOM::Event::ZEND, \&found,
30 exception => \&error);
36 my($conn, $task, $udata, $event) = @_;
37 my $index = $udata->{"index"};
39 my $n = $task->{rs}->size();
40 $task->{rs}->destroy();
41 $conn->log("irspy_test",
42 "CQL search on '$index' found $n record", $n==1 ? "" : "s");
43 $conn->record()->store_result("search_cql", index => $index, ok => 1);
44 return ZOOM::IRSpy::Status::TASK_DONE;
49 my($conn, $task, $udata, $exception) = @_;
50 my $index = $udata->{"index"};
52 $task->{rs}->destroy();
53 $conn->log("irspy_test", "CQL search on '$index' had error: $exception");
54 $conn->record()->store_result("search_cql", index => $index, ok => 0);
55 zoom_error_timeout_update($conn, $exception);
56 return ZOOM::IRSpy::Status::TEST_BAD
57 if $exception->code() == 11; # Unsupported query type
59 return ZOOM::IRSpy::Status::TASK_DONE;