| 1 | package KinoSearch1::Search::Hit; | ||||||||||||||||||||
| 2 | 20 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 20 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 20 | ▶ | use KinoSearch1::Util::ToolSet; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 20 | ▶ | use base qw( KinoSearch1::Util::Class ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 20 | ▶ | BEGIN { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 20 | __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 | __PACKAGE__->ready_get(qw( id score )); | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 47 | ▶ | sub get_doc { | ||||||||||||||||||
|
Subroutine
get_doc: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 21 | 47 | my $self = shift; | |||||||||||||||||||
| 22 | 47 | ▶ | $self->{doc} ||= $self->{searcher}->fetch_doc( $self->{id} ); | ||||||||||||||||||
|
Condition66%2/3
$self->{"doc"} ||= $self->{"searcher"}->fetch_doc($self->{"id"})
MC/DC0%0/2
$self->{"doc"} ||= $self->{"searcher"}->fetch_doc($self->{"id"})
$self->{"doc"}
$self->{"searcher"}->fetch_doc($self->{"id"})
Truth table66%2/3
A ||= B
A= $self->{"doc"}B= $self->{"searcher"}->fetch_doc($self->{"id"})
| |||||||||||||||||||||
| 23 | 47 | return $self->{doc}; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 43 | ▶ | sub get_field_values { | ||||||||||||||||||
|
Subroutine
get_field_values: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||
| 27 | 43 | my $self = shift; | |||||||||||||||||||
| 28 | 43 | ▶ | if ( !defined $self->{hashref} ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 43 | ▶ | if ( !defined $self->{doc} ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 30 | 43 | $self->get_doc; | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | 43 | $self->{hashref} = $self->{doc}->to_hashref; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | 43 | return $self->{hashref}; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 20 | 1; | |||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||