Many radical changes to the IRSpy engine, enabling a far more asynchronous approach...
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Task / Search.pm
1 # $Id: Search.pm,v 1.1 2006-10-06 11:33:08 mike Exp $
2
3 package ZOOM::IRSpy::Task::Search;
4
5 use 5.008;
6 use strict;
7 use warnings;
8
9 use ZOOM::IRSpy::Task;
10 our @ISA = qw(ZOOM::IRSpy::Task);
11
12 =head1 NAME
13
14 ZOOM::IRSpy::Task::Search - a searching task for IRSpy
15
16 =head1 SYNOPSIS
17
18  ## to follow
19
20 =head1 DESCRIPTION
21
22  ## to follow
23
24 =cut
25
26 sub new {
27     my $class = shift();
28     my($query) = shift();
29
30     my $this = $class->SUPER::new(@_);
31     $this->{query} = $query;
32     $this->{rs} = undef;
33     return $this;
34 }
35
36 sub run {
37     my $this = shift();
38
39     my $conn = $this->conn();
40     my $query = $this->{query};
41     $this->irspy()->log("irspy_test", $conn->option("host"),
42                         " searching for '$query'");
43     $this->{rs} = $conn->search_pqf($query);
44     # Wow -- that's it.
45 }
46
47 sub render {
48     my $this = shift();
49     return ref($this) . " " . $this->{query};
50 }
51
52 use overload '""' => \&render;
53
54
55 =head1 SEE ALSO
56
57 ZOOM::IRSpy
58
59 =head1 AUTHOR
60
61 Mike Taylor, E<lt>mike@indexdata.comE<gt>
62
63 =head1 COPYRIGHT AND LICENSE
64
65 Copyright (C) 2006 by Index Data ApS.
66
67 This library is free software; you can redistribute it and/or modify
68 it under the same terms as Perl itself, either Perl version 5.8.7 or,
69 at your option, any later version of Perl 5 you may have available.
70
71 =cut
72
73 1;