[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:43:54 CET 2023


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

Janusz Kaczmarek <januszop at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |januszop at gmail.com

--- Comment #5 from Janusz Kaczmarek <januszop at gmail.com> ---
Observations:

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").

So, the question mark should be removed from query term (clean_search_term) or
-- better -- escaped in the same way as slash is escaped
(_query_regex_escape_process). A patch will follow.

-- 
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