Plucene::Search::Hits - A list of ranked documents
my $hits = Plucene::Search::Hits->new;
my $doc = $hits->doc($n);
my $score = $hits->score($n);
my $hit_doc = $hits->hit_doc($n);
=head1 DESCRIPTION
This is a list of ranked documents, used to hold search results.
my $hits = Plucene::Search::Hits->new;
Get / set these attributes.
my $doc = $hits->doc($n);
Returns the nth document.
=cut
| sub doc {
| | my ($self, $n) = @_;
| | my $hit = $self->hit_doc($n); |
# Not sure we need the LRU for now
return $hit->doc || $hit->doc($self->searcher->doc($hit->id));
}
my $score = $hits->score($n);
The score of the nth document.
=cut
sub score {
my ($self, $n) = @_;
return $self->hit_doc($n)->score;
}
my $hit_doc = $hits->hit_doc($n);
Returns the nth hit document.
|