[Koha-bugs] [Bug 28316] Fix ES crashes related to various punctuation characters

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Aug 21 20:57:43 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28316

--- Comment #72 from Andrew Nugged <nugged at gmail.com> ---
Now regarding the current ticket - why it's appeared:


There already was some "prevention from dies (exceptions) in ES language" to
make requests "just regular characters" instead of special commands,

We already had some FUZY pre-processing before this current bugfix code in
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm, "sub _clean_search_term":
some extra "precleaning", 

for example, curly braces "{}" any of them were replaced by '"' doublequote,
and "=" replaced with ":",
and colons with space before or space after (": " or " :") were just removed so
only the space left,

but trailing colon, trailing exclamation mark, and square range braces which
actually not range (like in "[OHO]" phrase: ES dies because it's not [X TO Y]
format) misled ES and anyway made ES die sometimes,

So, that was incomplete and this ticket adds some more of such fuzziness but in
the proper way (for example, ranges like "{... TO ...]" (i.e. full mix of
],},[,{ now works), 

But please don't demand from it to be "fully covering ES language" thing, 

in my opinion, this ticket decreases the number of "crashes" and "syntax
errors" but at the same time, fixes range searches and started to recognize
even "ES regular expressions" if they are enabled (yes,
"QueryRegexEscapeOptions" case!), and fixes behavior with "QueryAutoTruncate"
enabled, let me provide some examples below.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list