From 9f3c45d62c1f3de66edc7d7a25f3c2d7f6afca54 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 --- 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.39.5