Author image Marvin Humphrey
and 1 contributors

NAME

KinoSearch::Search::HitCollector::BitCollector - HitCollector which records doc nums in a BitVector.

SYNOPSIS

    my $bit_vec = KinoSearch::Util::BitVector->new(
        capacity => $searcher->doc_max + 1,
    );
    my $bit_collector = KinoSearch::Search::HitCollector::BitCollector->new(
        bit_vector => $bit_vec, 
    );
    $searcher->collect(
        collector => $bit_collector,
        query     => $query,
    );

DESCRIPTION

BitCollector is a HitCollector which saves matching document ids in a BitVector while ignoring scores. It is useful for recording the entire set of documents which matches a query.

CONSTRUCTORS

new( [labeled params] )

    my $bit_collector = KinoSearch::Search::HitCollector::BitCollector->new(
        bit_vector => $bit_vec,    # required
    );
  • bit_vector - A KinoSearch::Util::BitVector.

METHODS

collect(doc_id)

Set bit in the object's BitVector for the supplied doc id.

INHERITANCE

KinoSearch::Search::HitCollector::BitCollector isa KinoSearch::Search::HitCollector isa KinoSearch::Obj.

COPYRIGHT

Copyright 2005-2009 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc.

See KinoSearch version 0.30.