From 6aa1ea5e0c1c2b39dc54ecb57584919a24930656 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 22 Sep 2022 19:54:07 +0000 Subject: [PATCH] Bug 29561: (follow-up) Don't remove facet '0' Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c4161b703e36c21e769e4abb5edc99cfc33af6c2) Signed-off-by: Lucas Gass --- 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 be31f50712..e8e4412b56 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -492,7 +492,7 @@ sub _convert_facets { $limit = @{ $data->{buckets} } if ( $limit > @{ $data->{buckets} } ); foreach my $term ( @{ $data->{buckets} }[ 0 .. $limit - 1 ] ) { my $t = $term->{key}; - next unless $t; # FIXME Currently we cannot search for an empty faceted field i.e. ln:"" to find records missing languages, though ES does count them correctly + next unless length($t); # FIXME Currently we cannot search for an empty faceted field i.e. ln:"" to find records missing languages, though ES does count them correctly my $c = $term->{doc_count}; my $label; if ( exists( $special{$type} ) ) { -- 2.39.5