From 8bb51dccb09722bde33b34ca5fa24f3181799454 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 22 Sep 2021 12:55:19 +0000 Subject: [PATCH] Bug 29077: Remove blank indexes before convert To test: 1 - Be using Elasticsearch 2 - Search on OPAC with dropdown set to 'Library catalog' 3 - Warns in plack-opac-error.log 4 - Apply patch 5 - Repeat 6 - No warns 7 - Search returns correct results Signed-off-by: Aleisha Amohia Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index 3e2cb1b784..43ee56684d 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -714,6 +714,8 @@ sub _convert_index_fields { my %index_type_convert = ( __default => undef, phr => 'phrase', rtrn => 'right-truncate', 'st-year' => 'st-year' ); + @indexes = grep(/.+/, @indexes); # Remove any blank indexes, i.e. keyword + # Convert according to our table, drop anything that doesn't convert. # If a field starts with mc- we save it as it's used (and removed) later # when joining things, to indicate we make it an 'OR' join. -- 2.39.5