From c9cc12b79c28af77855cd3a74f5865cfe21c5e5c 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. Signed-off-by: Nick Clemens Signed-off-by: Jesse Weaver Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher --- 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 92561e1d5b..1a74e95a98 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -417,7 +417,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.20.1