From 1eadb1a86bba985d0b5b4f432254cdf1531ac73e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 28 Aug 2015 11:24:24 +0100 Subject: [PATCH] Bug 12478: Display the correct number of facets (5 instead of 6) The loop on facet entries was wrong, it should stop after 5 iterations. --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 51e485f..56dec5a 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -415,7 +415,7 @@ sub _convert_facets { "type_label_$type_to_label{$type}" => 1, type_link_value => $type, }; - foreach my $term ( @{ $data->{terms} }[ 0 .. $limit ] ) { + foreach my $term ( @{ $data->{terms} }[ 0 .. $limit - 1 ] ) { my $t = $term->{term}; my $c = $term->{count}; if ( exists( $special{$type} ) ) { -- 2.1.0