From ecdefe969e76c0819e8386f8af539f79528a44b3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 24 Jun 2020 12:20:03 +0000 Subject: [PATCH] Bug 25864: Lower case fields for searching To recreate: 1 - Have Koha using ES5 and Elasticsearch as search engine 2 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate 3 - Do a search in authorities using 'Search entire record' (abduction if using sample db) 4 - Note no results 5 - View the page source and find 'search_query' 6 - Note the uppercased fields 7 - curl 'es:9200/koha_kohadev_authorities/data/417?pretty' 8 - Note all fields lower-cased 9 - Apply patch 10 - Repeat search 11 - It works! Signed-off-by: Heather Hernandez Signed-off-by: Alex Arnaud Signed-off-by: Jonathan Druart (cherry picked from commit 2ab6018b6e14ae2153093db148f04f71405f4493) Signed-off-by: Lucas Gass --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index 871f81d027..3c6aaa42b1 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -1170,7 +1170,7 @@ sub _search_fields { my @search_fields; while (my $search_field = $result->next) { push @search_fields, [ - $search_field->name, + lc $search_field->name, $search_field->weight ? $search_field->weight : () ]; } -- 2.39.5