NAME

KinoSearch::Index::PostingList - Term-Document pairings.

SYNOPSIS

    # PostingList is an abstract base class.  Objects which subclass it can be
    # obtained via IndexReader's posting_list() method.
    my $posting_list = $reader->posting_list( 
        field => 'content',
        term  => 'foo',
    );
    while ( my $doc_num = $posting_list->next ) {
        say "Matching doc num: $doc_num";
    }

DESCRIPTION

PostingList is an iterator which supplies a list of document numbers that match a given term. See KinoSearch::Docs::IRTheory for a more detailed explanation.

METHODS

seek(target)

Prepare the PostingList object to iterate over matches for documents that match target.

  • target - The term to match. If undef, the iterator will be empty.

next()

Advance the iterator to the next document.

Returns: A positive document number, or 0 once the iterator is exhausted.

get_doc_num()

Return the iterator's current document number. Should not be called before the iterator is initialized or after it empties.

get_doc_freq()

Return the number of documents that the PostingList contains. (This number will include any documents which have been marked as deleted but not yet purged.)

INHERITANCE

KinoSearch::Index::PostingList isa KinoSearch::Obj.

COPYRIGHT

Copyright 2005-2008 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc.

See KinoSearch version 0.20.

Copyright © 2004-2008 Marvin Humphrey