perldoc > Plucene::Search::HitCollector

πŸ“› NAME

Plucene::Search::HitCollector

πŸš€ Quick Reference

Use CaseCommandDescription
Create a collectormy $hc = Plucene::Search::HitCollector->new(collect => sub { ... });Pass a callback that receives each non‑zero scoring document
Search with collector$searcher->search_hc($query, $hc);Run the query and feed results to the collector
Callback signaturesub { my ($self, $doc, $score) = @_; ... }The callback receives the document number and its score

πŸ“‹ SYNOPSIS

# used in conjunction with the IndexSearcher

my $searcher = Plucene::Search::IndexSearcher->new($DIRECTORY);

my $hc = Plucene::Search::HitCollector->new( collect =>
    sub {
        my ($self, $doc, $score) = @_;
        ...
});

$searcher->search_hc($QUERY, $hc);

πŸ“– DESCRIPTION

This is used in conjunction with the IndexSearcher, in that whenever a non‑zero scoring document is found, the subref with which the HitCollector was made will get called.

πŸ› οΈ METHODS

πŸ—οΈ new

my $hc = Plucene::Search::HitCollector->new( collect =>
    sub {
        my ($self, $doc, $score) = @_;
        ...
});

This will create a new Plucene::Search::HitCollector with the passed subref.

πŸ“₯ collect

This is called once for every non‑zero scoring document, with the document number and its score.

Plucene::Search::HitCollector
πŸ“› NAME πŸš€ Quick Reference πŸ“‹ SYNOPSIS πŸ“– DESCRIPTION πŸ› οΈ METHODS
πŸ—οΈ new πŸ“₯ collect

Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-20 17:58 @2600:1f28:365:80b0:8802:8bb4:3873:328e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format