| 1 | package Plucene::Search::TopDocs; | ||||||||||
| 2 | |||||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | |||||||||||
| 5 | Plucene::Search::TopDocs - The top hits for a query | ||||||||||
| 6 | |||||||||||
| 7 | =head1 SYNOPSIS | ||||||||||
| 8 | |||||||||||
| 9 | my $total_hits = $top_docs->total_hits; | ||||||||||
| 10 | my @score_docs = $top_docs->score_docs(@other); | ||||||||||
| 11 | |||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||
| 13 | |||||||||||
| 14 | =head1 METHODS | ||||||||||
| 15 | |||||||||||
| 16 | =head2 total_hits | ||||||||||
| 17 | |||||||||||
| 18 | my $total_hits = $top_docs->total_hits; | ||||||||||
| 19 | |||||||||||
| 20 | The total number of hits for the query. | ||||||||||
| 21 | |||||||||||
| 22 | =cut | ||||||||||
| 23 | |||||||||||
| 24 | 16 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 16 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | |||||||||||
| 27 | 16 | ▶ | use base 'Class::Accessor::Fast'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | |||||||||||
| 29 | 16 | __PACKAGE__->mk_accessors(qw/ total_hits score_docs /); | |||||||||
| 30 | |||||||||||
| 31 | =head2 score_docs | ||||||||||
| 32 | |||||||||||
| 33 | my @score_docs = $top_docs->score_docs(@other); | ||||||||||
| 34 | |||||||||||
| 35 | The top hits for the query. | ||||||||||
| 36 | |||||||||||
| 37 | =cut | ||||||||||
| 38 | |||||||||||
| 39 | 189 | ▶ | sub score_docs { | ||||||||
|
Subroutine
score_docs: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||
| 40 | 189 | my ($self, @other) = @_; | |||||||||
| 41 | 0 | ▶ | if (@other) { $self->{score_docs} = [@other] } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | 189 | @{ $self->{score_docs} }; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 16 | 1; | |||||||||