From b837b205b055851aa87bd2f21b6abd1591b0366e Mon Sep 17 00:00:00 2001 From: Andrew Nugged Date: Sat, 21 Aug 2021 11:40:58 +0300 Subject: [PATCH] Bug 28736: (QA follow-up) hints in explanation about broken syntax Add direct hint for the user what might be the issues with search phrase. In most cases we have unescaped or not removed special characters when user copy-pastes book name. If we explain that error happens because there is special search language, user will know what to research because we explicitly will tell that this is NOT the empty result, but search wasn't performed. --- Koha/SearchEngine/Elasticsearch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 803f152487..05bd2840d8 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -1218,7 +1218,7 @@ sub process_error { warn $msg; # simple logging # This is super-primitive - return "Unable to understand your search query, please rephrase and try again.\n" if $msg =~ /ParseException|parse_exception/; + return "There might be results! But there is ElasticSearch query language syntax error in your query: remove or escape special characters or rephrase and try again.\n" if $msg =~ /ParseException|parse_exception/; return "Unable to perform your search. Please try again.\n"; } -- 2.33.0