Branch Coverage

blib/lib/Interchange/Search/Solr.pm
Criterion Covered Total %
branch 6 204 2.9


line true false branch
264 0 0 if (my $stops = Lingua::StopWords::getStopWords($lang, 'UTF-8'))
365 0 0 if ($self->response->ok)
371 0 0 if $name =~ /^_/
460 0 0 if @_
464 0 0 if ($string and ref $string)
469 0 0 if ($string)
484 0 0 if ($self->wild_matching)
488 0 0 if (@terms) { }
496 0 0 if (my $structure = $self->search_structure)
518 0 0 if (@terms or %filters or $structure) { }
529 0 0 if (ref $query) { }
0 0 elsif ($query) { }
536 0 0 if (my $global = $self->global_conditions)
540 0 0 if (ref $global->{$condition} eq 'SCALAR') { }
555 0 0 unless ($self->permit_empty_search)
556 0 0 if ($self->_search_is_empty)
561 0 0 unless ($our_res)
567 0 0 unless ($our_res->success)
591 0 0 if (my $facet_field = $self->facets)
597 0 0 if (my $filters = $self->filters)
599 0 0 if (my $condition = $filters->{$facet})
609 0 0 if (my $facet_ranges = $self->facet_ranges)
614 0 0 unless $f
616 0 0 if (defined $fr->{$k})
622 0 0 if (@ranges)
626 0 0 if (my $filters = $self->filters)
628 0 0 if (my $condition = $filters->{$facet})
630 0 0 if (defined $from and defined $to and $from =~ /\A[1-9][0-9]*\z/ and $to =~ /\A[1-9][0-9]*\z/)
642 0 0 if (@fq)
647 0 0 if (my $sort_by = $self->sorting)
649 0 0 if (ref $sort_by) { }
657 0 0 if (my $fl = $self->return_fields)
678 0 0 unless $maybe_num
679 0 0 if ($maybe_num =~ /([1-9][0-9]*)/) { }
689 0 0 if (my $res = $self->response) { }
700 0 0 if ($self->response->ok)
734 0 0 if (my $facets = $self->response->content->{'facet_counts'}{'facet_ranges'})
736 0 0 if (my $range = $facets->{$field})
737 0 0 if (my $counts = $range->{'counts'})
738 0 0 if (ref $counts eq 'ARRAY')
760 0 0 if ($self->num_found > $self->_start_row + $self->_rows) { }
848 0 0 unless $mode
851 0 0 if ($mode eq 'add') { }
0 0 elsif ($mode eq 'clear') { }
0 0 elsif ($mode eq 'full') { }
0 0 elsif ($mode eq 'delta') { }
867 0 0 unless ($res)
872 0 0 if ($res->success)
889 1 2 if (ref $input eq 'ARRAY') { }
2 0 elsif (ref $input eq 'HASH') { }
903 4 0 if (defined $value)
905 2 2 if (ref $value eq 'ARRAY') { }
931 0 0 if (ref $input eq 'ARRAY') { }
974 0 0 if (my $enc = $self->input_encoding)
1006 0 0 unless defined $url
1008 0 0 unless @other_terms
1025 0 0 unless $url
1029 0 0 unless @fragments
1033 0 0 if ($fragments[0] eq 'words')
1037 0 0 if (@fragments)
1043 0 0 if (@fragments > 1)
1045 0 0 if ($fragments[$page - 1] eq 'page')
1050 0 0 if ($page =~ s/^([1-9][0-9]*)$/)/) { }
1066 0 0 if ($self->_fragment_is_keyword($chunk) and @fragments and not $self->_fragment_is_keyword($fragments[0]))
1077 0 0 if ($current_filter) { }
1092 0 0 unless defined $fragment
1113 0 0 unless ($args{'hide_page'})
1151 0 0 unless $filters->{$facet}
1154 0 0 if ($self->_filter_is_active($facet, $name)) { }
0 0 elsif ($facet eq $field) { }
1162 0 0 if @active
1172 0 0 if (my $list = $self->filters->{$field})
1173 0 0 if (my(@active) = @$list)
1174 0 0 if (grep {$_ eq $name;} @active)
1238 0 0 unless $total
1240 0 0 if $total_pages < 2
1243 0 0 $page - $page_scope > 0 ? :
1244 0 0 $page + $page_scope < $total_pages ? :
1258 0 0 if ($position == 0) { }
0 0 elsif ($position == 1) { }
0 0 elsif ($position == -1) { }
1271 0 0 if ($page != $total_pages)
1276 0 0 if ($page != 1)
1320 0 0 unless @terms
1374 0 0 if (%$filters)
1376 0 0 if (my $terms = $filters->{$facet})
1389 0 0 if (my $terms = $filters->{$facet})
1407 0 0 if (my $struct = $self->terms_found) { }
1418 0 0 if (my $struct = $self->terms_found)
1419 0 0 if (my $terms = $struct->{'terms'})
1433 0 0 if ($term and $term =~ /\w/)
1434 0 0 if ($self->stop_words->{lc $term})
1437 0 0 if ($self->min_chars > 1)
1439 0 0 if ($term =~ /$re/) { }
1471 0 0 unless $key
1472 0 0 if (@rest or not $key =~ /^-(desc|asc)/i)
1497 0 0 unless defined $data
1499 0 0 &Scalar::Util::blessed($data) ? :
1500 0 0 unless $ref
1504 0 0 &Scalar::Util::blessed($data) ? :
1505 0 0 if $ref
1514 0 0 unless $coderef