@@ -, +, @@ --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ a/Koha/SearchEngine/Elasticsearch/Search.pm @@ -416,7 +416,7 @@ sub _convert_facets { "type_label_$type_to_label{$type}" => 1, type_link_value => $type, }; - $limit = $#{ $data->{terms} } if ( $limit > @{ $data->{terms} } ); + $limit = @{ $data->{terms} } if ( $limit > @{ $data->{terms} } ); foreach my $term ( @{ $data->{terms} }[ 0 .. $limit - 1 ] ) { my $t = $term->{term}; my $c = $term->{count}; --