Bugzilla – Attachment 124007 Details for
Bug 28736
Better error message when ES fails to understand the syntax of the search query
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28736: (QA follow-up) hints in explanation about broken syntax
Bug-28736-QA-follow-up-hints-in-explanation-about-.patch (text/plain), 1.50 KB, created by
Andrii Nugged
on 2021-08-21 18:48:07 UTC
(
hide
)
Description:
Bug 28736: (QA follow-up) hints in explanation about broken syntax
Filename:
MIME Type:
Creator:
Andrii Nugged
Created:
2021-08-21 18:48:07 UTC
Size:
1.50 KB
patch
obsolete
>From 588889560583278fed3335e4459ffe9458390f7c Mon Sep 17 00:00:00 2001 >From: Andrew Nugged <nugged@gmail.com> >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 | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 803f152487..4f24e9c4b4 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -1218,7 +1218,9 @@ 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 request: ". >+ "remove or escape with backslash special ES characters like !:[]{}^ or create a proper ES-language request and try again.\n" >+ if $msg =~ /ParseException|parse_exception/; > > return "Unable to perform your search. Please try again.\n"; > } >-- >2.33.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28736
:
123046
|
123181
|
123404
|
123985
|
124005
|
124006
|
124007
|
124008