line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package KinoSearch1::Search::Hit; |
2
|
20
|
|
|
20
|
|
105
|
use strict; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
645
|
|
3
|
20
|
|
|
20
|
|
103
|
use warnings; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
624
|
|
4
|
20
|
|
|
20
|
|
139
|
use KinoSearch1::Util::ToolSet; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
2978
|
|
5
|
20
|
|
|
20
|
|
114
|
use base qw( KinoSearch1::Util::Class ); |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
2135
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
20
|
|
|
20
|
|
187
|
__PACKAGE__->init_instance_vars( |
9
|
|
|
|
|
|
|
# constructor params / members |
10
|
|
|
|
|
|
|
id => undef, |
11
|
|
|
|
|
|
|
score => undef, |
12
|
|
|
|
|
|
|
searcher => undef, |
13
|
|
|
|
|
|
|
# members |
14
|
|
|
|
|
|
|
doc => undef, |
15
|
|
|
|
|
|
|
hashref => undef, |
16
|
|
|
|
|
|
|
); |
17
|
20
|
|
|
|
|
189
|
__PACKAGE__->ready_get(qw( id score )); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub get_doc { |
21
|
53
|
|
|
53
|
1
|
92
|
my $self = shift; |
22
|
53
|
|
66
|
|
|
338
|
$self->{doc} ||= $self->{searcher}->fetch_doc( $self->{id} ); |
23
|
53
|
|
|
|
|
178
|
return $self->{doc}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub get_field_values { |
27
|
46
|
|
|
46
|
1
|
82
|
my $self = shift; |
28
|
46
|
50
|
|
|
|
207
|
if ( !defined $self->{hashref} ) { |
29
|
46
|
50
|
|
|
|
137
|
if ( !defined $self->{doc} ) { |
30
|
46
|
|
|
|
|
136
|
$self->get_doc; |
31
|
|
|
|
|
|
|
} |
32
|
46
|
|
|
|
|
211
|
$self->{hashref} = $self->{doc}->to_hashref; |
33
|
|
|
|
|
|
|
} |
34
|
46
|
|
|
|
|
151
|
return $self->{hashref}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |