+ " searching for '$qtype:$qstr'");
+ if (defined $this->{rs}) {
+ $this->set_options();
+ die "task $this has resultset?!";
+ }
+
+ my $query;
+ if ($qtype eq "pqf") {
+ $query = new ZOOM::Query::PQF($qstr);
+ } elsif ($qtype eq "cql") {
+ $query = new ZOOM::Query::CQL($qstr);
+ } else {
+ $this->set_options();
+ die "Huh?!";
+ }
+
+ ### Note well that when this task runs, it creates a result-set
+ # object which MUST BE DESTROYED in order to prevent large-scale
+ # memory leakage. So when creating a Task::Search, it is the
+ # APPLICATION'S RESPONSIBILITY to ensure that the callback
+ # invoked on success OR FAILURE makes arrangements for the set
+ # to be destroyed.
+ eval {
+ $this->{rs} = $conn->search($query);
+ }; if ($@) {
+ $this->set_options();
+ die "remote search '$query' had error: '$@'";
+ }
+