Bug 27431

Summary: ES searches containing words starting with 2 hyphens or only hyphen(s) fail
Product: Koha Reporter: Alex Arnaud <alex.arnaud>
Component: Searching - ElasticsearchAssignee: Alex Arnaud <alex.arnaud>
Status: Failed QA --- QA Contact:
Severity: normal    
Priority: P5 - low CC: hagud, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 27431: Elasticsearch - escape words that equal to hyphen or starting with more than one hyphen
Bug 27431: Elasticsearch - escape words that equal to hyphen or starting with more than one hyphen

Description Alex Arnaud 2021-01-14 13:05:25 UTC
On ElasticSearch, query like "(--)", "(-)" or "(--science)" fails.

In authority module (authorities-home.pl or auth-finder.pl), searching a term like "Science -- fiction" produce a query that fail: "(Science) AND (--) AND (fiction)"
Comment 1 Alex Arnaud 2021-01-14 13:16:57 UTC
Created attachment 115156 [details] [review]
Bug 27431: Elasticsearch - escape words that equal to hyphen or starting with more than one hyphen
Comment 2 PTFS Europe Sandboxes 2021-03-19 09:24:52 UTC
Created attachment 118499 [details] [review]
Bug 27431: Elasticsearch - escape words that equal to hyphen or starting with more than one hyphen

Signed-off-by: HUGO AGUD <hagud@orex.es>
Comment 3 Nick Clemens (kidclamp) 2021-05-07 14:32:29 UTC
Can we get a more detailed test plan and some unit tests for this one?

Terms beginning with '-' are treated as negtive terms, i.e. the results shouldn't have them - this doesn't seem to affect that

Is this affecting biblio search as well as auth?