[Koha-bugs] [Bug 28884] ElasticSearch: Question mark in title search returns no results
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Feb 22 15:57:30 CET 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28884
Janusz Kaczmarek <januszop at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |Needs Signoff
Assignee|koha-bugs at lists.koha-commun |januszop at gmail.com
|ity.org |
--- Comment #6 from Janusz Kaczmarek <januszop at gmail.com> ---
Created attachment 147161
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147161&action=edit
[PATCH] Bug 28884: ElasticSearch: Question mark in title search returns no
results
1. It happens that question mark (‘?’) is contained in bibliographic
data (e.g. in title).
2. It happens that user perform searches with that contain question
mark (e.g. searching with a title taken verbatim).
3. In ES queries, in particular in query_string query, question
mark has a special meaning – substitutes one character
(https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-wildcard).
Question mark has also special meaning in regexp inside
quiery_string
(https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_regular_expressions).
4. Ordinary users are not aware of this special function of the
question mark and, as a result, receive no results (e.g.
while searching for title like "Will libraries survive? :
the future of public libraries").
Test plan:
==========
1. Have biblio record with title like
245 10 $a Will libraries survive? : $b the future of public libraries.
(= with question mark attached to a word) in Koha instance with ES.
2. Search for: Will libraries survive? the future of public libraries
You should get no results.
3. Apply the patch, controll that QueryRegexEscapeOptions is set to
Escape.
4. Repeat the search. You should get the record.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list