NAME

KinoSearch::Search::Scorer - Score documents against a Query.

SYNOPSIS

    # Scorer is an abstract base class -- see MockScorer for an example
    # implementation.

DESCRIPTION

Scorers iterate through a list of documents, producing score/doc_num pairs for further processing, typically by a HitCollector.

CONSTRUCTOR

new( [labeled params] )

    my $scorer = MyScorer->SUPER::new(
        similarity => $sim,
    );

Abstract constructor.

  • similarity - A Similarity.

METHODS

next()

Move the internal state of the scorer to the next document.

Returns: either a positive document number, or 0 (an invalid document number) when there are no more documents which match.

skip_to(target)

Skip to the first document number equal to or greater than the target. The default implementation just calls scorer_next() over and over.

  • target - A positive document number.

Returns: either a positive document number, or 0 (an invalid document number) when there are no more documents which match.

get_doc_num()

Return the scorer's current document number. Valid only after a successful call to next() or skip_to() and must not be called otherwise.

tally()

Return a Tally containing scoring information. Valid only after a successful call to next() or skip_to() and must not be called otherwise.

INHERITANCE

KinoSearch::Search::Scorer isa KinoSearch::Obj.

COPYRIGHT

Copyright 2005-2008 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc.

See KinoSearch version 0.20.

Copyright © 2004-2008 Marvin Humphrey