line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package KinoSearch1::Search::HitQueue; |
2
|
20
|
|
|
20
|
|
21930
|
use strict; |
|
20
|
|
|
|
|
47
|
|
|
20
|
|
|
|
|
711
|
|
3
|
20
|
|
|
20
|
|
107
|
use warnings; |
|
20
|
|
|
|
|
44
|
|
|
20
|
|
|
|
|
921
|
|
4
|
20
|
|
|
20
|
|
590
|
use KinoSearch1::Util::ToolSet; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
2859
|
|
5
|
20
|
|
|
20
|
|
115
|
use base qw( KinoSearch1::Util::PriorityQueue ); |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
19735
|
|
6
|
|
|
|
|
|
|
|
7
|
20
|
|
|
20
|
|
246
|
BEGIN { __PACKAGE__->init_instance_vars() } |
8
|
|
|
|
|
|
|
|
9
|
20
|
|
|
20
|
|
12582
|
use KinoSearch1::Search::Hit; |
|
20
|
|
|
|
|
51
|
|
|
20
|
|
|
|
|
4069
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
285
|
|
|
285
|
1
|
687
|
my $either = shift; |
13
|
285
|
|
|
|
|
4613
|
my $self = $either->SUPER::new(@_); |
14
|
|
|
|
|
|
|
|
15
|
285
|
|
|
|
|
1565
|
$self->define_less_than; |
16
|
|
|
|
|
|
|
|
17
|
285
|
|
|
|
|
1010
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Create an array of "empty" Hit objects -- they have scores and ids, |
21
|
|
|
|
|
|
|
# but the stored fields have yet to be retrieved. |
22
|
|
|
|
|
|
|
sub hits { |
23
|
285
|
|
|
285
|
0
|
2013
|
my ( $self, $start_offset, $num_wanted, $searcher ) = @_; |
24
|
285
|
|
|
|
|
491
|
my @hits = @{ $self->pop_all }; |
|
285
|
|
|
|
|
2449
|
|
25
|
|
|
|
|
|
|
|
26
|
285
|
100
|
66
|
|
|
1927
|
if ( defined $start_offset and defined $num_wanted ) { |
27
|
283
|
|
|
|
|
1381
|
@hits = splice( @hits, $start_offset, $num_wanted ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
831
|
|
|
|
|
4993
|
@hits = map { |
31
|
285
|
|
|
|
|
742
|
KinoSearch1::Search::Hit->new( |
32
|
|
|
|
|
|
|
id => unpack( 'N', "$_" ), |
33
|
|
|
|
|
|
|
score => 0 + $_, |
34
|
|
|
|
|
|
|
searcher => $searcher |
35
|
|
|
|
|
|
|
) |
36
|
|
|
|
|
|
|
} @hits; |
37
|
|
|
|
|
|
|
|
38
|
285
|
|
|
|
|
3158
|
return \@hits; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |