@@ -, +, @@ facet available --- 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 @@ -406,7 +406,6 @@ sub _convert_facets { # We restrict to the most popular $limit results my $limit = ( $type eq $exp_facet ) ? 10 : 5; - $limit = $#{ $data->{terms} } if ( $limit > @{ $data->{terms} } ); my $facet = { type_id => $type . '_id', expand => $type, @@ -415,6 +414,7 @@ sub _convert_facets { "type_label_$type_to_label{$type}" => 1, type_link_value => $type, }; + $limit = $#{ $data->{terms} } if ( $limit > @{ $data->{terms} } ); foreach my $term ( @{ $data->{terms} }[ 0 .. $limit - 1 ] ) { my $t = $term->{term}; my $c = $term->{count}; --