Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Plucene::Search::Hits

Name Plucene::Search::Hits
Version
Located at /usr/share/perl5
File /usr/share/perl5/Plucene/Search/Hits.pm
Is Core No
Search CPAN for this module Plucene::Search::Hits
Documentation Plucene::Search::Hits
Module Details Plucene::Search::Hits

NAME

Plucene::Search::Hits - A list of ranked documents


SYNOPSIS

        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.


METHODS

new

        my $hits = Plucene::Search::Hits->new;

query / searcher / filter / length / hit_docs / first / last / num_docs / max_docs

Get / set these attributes.

doc

        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));
}

score

        my $score = $hits->score($n);

The score of the nth document.


=cut

sub score { my ($self, $n) = @_; return $self->hit_doc($n)->score; }

hit_doc

        my $hit_doc = $hits->hit_doc($n);

Returns the nth hit document.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026