line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package KinoSearch1::Index::MultiTermDocs; |
2
|
34
|
|
|
34
|
|
4908
|
use strict; |
|
34
|
|
|
|
|
74
|
|
|
34
|
|
|
|
|
1219
|
|
3
|
34
|
|
|
34
|
|
198
|
use warnings; |
|
34
|
|
|
|
|
72
|
|
|
34
|
|
|
|
|
888
|
|
4
|
34
|
|
|
34
|
|
204
|
use KinoSearch1::Util::ToolSet; |
|
34
|
|
|
|
|
69
|
|
|
34
|
|
|
|
|
4996
|
|
5
|
34
|
|
|
34
|
|
211
|
use base qw( KinoSearch1::Index::TermDocs ); |
|
34
|
|
|
|
|
76
|
|
|
34
|
|
|
|
|
3335
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
34
|
|
|
34
|
|
696
|
__PACKAGE__->init_instance_vars( |
9
|
|
|
|
|
|
|
sub_readers => undef, |
10
|
|
|
|
|
|
|
starts => undef, |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
our %instance_vars; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
3
|
|
|
3
|
1
|
31
|
my $self = shift->SUPER::new; |
17
|
3
|
50
|
|
|
|
16
|
confess kerror() unless verify_args( \%instance_vars, @_ ); |
18
|
3
|
|
|
|
|
14
|
my %args = ( %instance_vars, @_ ); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# get a SegTermDocs for each segment |
21
|
3
|
|
50
|
|
|
15
|
my $sub_readers = $args{sub_readers} || []; |
22
|
3
|
|
50
|
|
|
21
|
my $starts = $args{starts} || []; |
23
|
3
|
|
|
|
|
8
|
my @sub_term_docs = map { $_->term_docs } @$sub_readers; |
|
12
|
|
|
|
|
38
|
|
24
|
3
|
|
|
|
|
38
|
_init_child( $self, \@sub_term_docs, $starts ); |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
|
|
14
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub seek { |
30
|
4
|
|
|
4
|
0
|
12
|
my ( $self, $term ) = @_; |
31
|
4
|
|
|
|
|
20
|
$_->seek($term) for @{ $self->_get_sub_term_docs }; |
|
4
|
|
|
|
|
29
|
|
32
|
4
|
|
|
|
|
20
|
$self->_reset_pointer; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub set_read_positions { |
36
|
1
|
|
|
1
|
0
|
1898
|
my ( $self, $val ) = @_; |
37
|
1
|
|
|
|
|
2
|
$_->set_read_positions($val) for @{ $self->_get_sub_term_docs }; |
|
1
|
|
|
|
|
15
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub close { |
41
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
42
|
0
|
|
|
|
|
|
$_->close for @{ $self->_get_sub_term_docs }; |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |