line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
16
|
|
101
|
use strict; |
|
16
|
|
|
|
|
33
|
|
|
16
|
|
|
|
|
573
|
|
25
|
16
|
|
|
16
|
|
89
|
use warnings; |
|
16
|
|
|
|
|
35
|
|
|
16
|
|
|
|
|
442
|
|
26
|
|
|
|
|
|
|
|
27
|
16
|
|
|
16
|
|
89
|
use base 'Class::Accessor::Fast'; |
|
16
|
|
|
|
|
234
|
|
|
16
|
|
|
|
|
2804
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__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
|
|
|
|
|
|
|
sub score_docs { |
40
|
176
|
|
|
176
|
1
|
378
|
my ($self, @other) = @_; |
41
|
176
|
50
|
|
|
|
614
|
if (@other) { $self->{score_docs} = [@other] } |
|
0
|
|
|
|
|
0
|
|
42
|
176
|
|
|
|
|
316
|
@{ $self->{score_docs} }; |
|
176
|
|
|
|
|
962
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |