Bug 21084 - Searching for authorities with 'contains' gives no results if search terms include punctuation
Summary: Searching for authorities with 'contains' gives no results if search terms in...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Ere Maijala
QA Contact:
URL:
Keywords:
Depends on: 20273
Blocks: 22997
  Show dependency treegraph
 
Reported: 2018-07-18 19:31 UTC by Katrin Fischer
Modified: 2019-05-28 13:46 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21084: Fix automatic truncation in authority search (11.96 KB, patch)
2018-12-05 14:28 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 21084: Fix automatic truncation in authority search (12.04 KB, patch)
2018-12-07 13:02 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21084: Fix automatic truncation in authority search (12.09 KB, patch)
2019-01-13 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-07-18 19:31:42 UTC
Try the authority linker plugin dependent bugs applied.

To test:
- Go to catalouging
- Start a new record with the default framework
- Click on the authority linker on 100$a
- Don't change any setting in the form and type "smi" into the first input field "main heading"
- The auto-complete feature will suggest several Smiths (assuming you are using the standard sample data, otherwise look for another example with multiple results)
- Pick one of the Smiths (note: all headings shown include some kind of punctuation, like a comma between firstname and surname).
- Search for the selected heading.
- Verify there are no search results.
- Remove any punctuation
- Verify the correct record is now found
Comment 1 Ere Maijala 2018-12-05 14:28:52 UTC
Created attachment 82868 [details] [review]
Bug 21084: Fix automatic truncation in authority search

- Makes token splitting work like in biblio search
- Only adds right hand truncation since that's what Zebra also does
- Only adds truncation if the token is not a phrase and ends in a word character
- Adds tests to existing and new QueryBuilder functions

Test plan:

1. Create an authority record for "Duck, Donald"
2. Try contains type authority searches with the following terms and make sure they find the record:
Duck, Donald
donald duck
don duck
"Duck, Donald"
3. Make sure the following search works but does not find anything:
"Duck, Don"
Comment 2 Nick Clemens 2018-12-07 13:02:01 UTC
Created attachment 82966 [details] [review]
Bug 21084: Fix automatic truncation in authority search

- Makes token splitting work like in biblio search
- Only adds right hand truncation since that's what Zebra also does
- Only adds truncation if the token is not a phrase and ends in a word character
- Adds tests to existing and new QueryBuilder functions

Test plan:

1. Create an authority record for "Duck, Donald"
2. Try contains type authority searches with the following terms and make sure they find the record:
Duck, Donald
donald duck
don duck
"Duck, Donald"
3. Make sure the following search works but does not find anything:
"Duck, Don"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 3 Katrin Fischer 2018-12-15 09:10:14 UTC
Assuming Nick forgot to switch status!
Comment 4 Katrin Fischer 2019-01-13 21:17:31 UTC
Created attachment 83852 [details] [review]
Bug 21084: Fix automatic truncation in authority search

- Makes token splitting work like in biblio search
- Only adds right hand truncation since that's what Zebra also does
- Only adds truncation if the token is not a phrase and ends in a word character
- Adds tests to existing and new QueryBuilder functions

Test plan:

1. Create an authority record for "Duck, Donald"
2. Try contains type authority searches with the following terms and make sure they find the record:
Duck, Donald
donald duck
don duck
"Duck, Donald"
3. Make sure the following search works but does not find anything:
"Duck, Don"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2019-01-13 21:17:42 UTC
Much better!
Comment 6 Nick Clemens 2019-01-18 20:57:26 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2019-01-23 12:44:10 UTC
Pushed to 18.11.x for 18.11.03
Comment 8 Jesse Maseto 2019-01-23 19:14:52 UTC
Merge conflicts with 18.05. Will not be backported.