From 2e4124af984b35e7ea2abc53cd8d6dfd8f107d4c 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' --- 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.30.2