Plucene::Search::PhraseScorer - a phrase scorer
# isa Plucene::Search::Scorer
$scorer->score($results, $end);
=head1 DESCRIPTION
This is the phrase scorer.
$scorer->score($results, $end);
=cut
sub score {
my ($self, $results, $end) = @_;
while ($self->last->doc < $end) {
while ($self->first->doc < $self->last->doc) {
do {
$self->first->next;
} while $self->first->doc < $self->last->doc;
$self->_first_to_last;
return if $self->last->doc >= $end;
}
my $freq = $self->_phrase_freq;
$self->_score_it($freq, $self->first->doc, $results);
$self->last->next;
}
}
sub _first_to_last {
my $self = shift;
$self->last->next_in_list($self->first);
$self->last($self->first);
$self->first($self->first->next_in_list);
$self->last->next_in_list(undef);
}
1;
|