1Lucy::Search::CollectorU(s3e)r Contributed Perl DocumentaLtuicoyn::Search::Collector(3)
2
3
4
6 Lucy::Search::Collector - Process hits.
7
9 # Abstract base class.
10
12 A Collector decides what to do with the hits that a Matcher iterates
13 through, based on how the abstract collect() method is implemented.
14
15 Collectors operate on individual segments, but must operate within the
16 context of a larger collection. Each time the collector moves to a new
17 segment, Set_Reader(), Set_Base() and Set_Matcher() will be called, and
18 the collector must take the updated information into account.
19
21 new
22 package MyCollector;
23 use base qw( Lucy::Search::Collector );
24 our %foo;
25 sub new {
26 my $self = shift->SUPER::new;
27 my %args = @_;
28 $foo{$$self} = $args{foo};
29 return $self;
30 }
31
32 Abstract constructor. Takes no arguments.
33
35 collect
36 $collector->collect($doc_id);
37
38 Do something with a doc id. (For instance, keep track of the docs with
39 the ten highest scores.)
40
41 • doc_id - A segment document id.
42
44 Lucy::Search::Collector isa Clownfish::Obj.
45
46
47
48perl v5.32.1 2021-01-27 Lucy::Search::Collector(3)