Bug 24264 - Elasticsearch - Cannot search for genre/form authorities
Summary: Elasticsearch - Cannot search for genre/form authorities
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: 19.05
Hardware: All All
: P5 - low major
Assignee: Nick Clemens (kidclamp)
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-18 14:11 UTC by Nick Clemens (kidclamp)
Modified: 2021-06-14 21:28 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.07
Circulation function:


Attachments
Bug 24264: Use raw field when limiting by authtype (1.25 KB, patch)
2019-12-18 14:14 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 24264: Use raw field when limiting by authtype (1.25 KB, patch)
2019-12-30 12:30 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 24264: Use raw field when limiting by authtype (1.32 KB, patch)
2019-12-31 01:10 UTC, Myka Kennedy Stephens
Details | Diff | Splinter Review
Bug 24264: Use raw field when limiting by authtype (1.39 KB, patch)
2020-01-02 11:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2019-12-18 14:11:46 UTC
When search with an authtype in ES we are using the term filter to limit to a type. This filter is analyzed and the forward slash in genre/form seems to be problematic

bug 20589 fixed this incidentally to other changes, however, 19.05 still has this bug.
Comment 1 Nick Clemens (kidclamp) 2019-12-18 14:14:56 UTC
Created attachment 96421 [details] [review]
Bug 24264: Use raw field when limiting by authtype

To test:
1 - Have a genre form record in your authorities file
2 - Search authorities for 'Default'
3 - The result is returned
4 - Set the dropdown to 'Genre/Form' and search matchign term
5 - No results
6 - Apply patch
7 - Restart all the things
8 - Repeat search for 'Genre/Form' and search matching term
9 - Record is returned
Comment 2 Myka Kennedy Stephens 2019-12-25 19:03:16 UTC
I'm sorry, Nick, but I can't get the patch to apply. I've tried on two different systems (Mac and Linux) using docker.

Results:
Setup: 19.05.x branch (19.05.06.000 on last attempt); ES enabled, query auto truncate turned off
1. There are 13 authority records in the test database containing "fiction"
2. 'Default' authority search for "fiction" 
3. Yields 13 results - 3 topical and 10 genre/form
4. 'Genre/Form Term' authority search for "fiction"
5. Yields 0 results
6. Apply patch
7. restart_all, updatedatabase, dbic, reindex ES
8. 'Genre/Form Term' authority search for "fiction"
9. Yields 0 results

Plack error log doesn't show anything. If there's another place to check for errors to troubleshoot the patch, please let me know.
Comment 3 Nick Clemens (kidclamp) 2019-12-30 12:30:17 UTC
Created attachment 96682 [details] [review]
Bug 24264: Use raw field when limiting by authtype

To test:
1 - Have a genre form record in your authorities file
2 - Search authorities for 'Default'
3 - The result is returned
4 - Set the dropdown to 'Genre/Form' and search matchign term
5 - No results
6 - Apply patch
7 - Restart all the things
8 - Repeat search for 'Genre/Form' and search matching term
9 - Record is returned
Comment 4 Nick Clemens (kidclamp) 2019-12-30 12:32:17 UTC
(In reply to Myka Kennedy Stephens from comment #2)
> I'm sorry, Nick, but I can't get the patch to apply. I've tried on two
> different systems (Mac and Linux) using docker.
> 
Hi Myka,

'Patch does not apply' is for when there are errors when trying to apply the patch

'Failed QA' is for when a patch doesn't work after it is applied. That was the case here, I wrote a bad patch :-)

When using 'raw' we also need to remove the lowercasing, otherwise it doesn't match.

New patch attached, please retest
Comment 5 Myka Kennedy Stephens 2019-12-31 01:10:24 UTC
Created attachment 96694 [details] [review]
Bug 24264: Use raw field when limiting by authtype

To test:
1 - Have a genre form record in your authorities file
2 - Search authorities for 'Default'
3 - The result is returned
4 - Set the dropdown to 'Genre/Form' and search matchign term
5 - No results
6 - Apply patch
7 - Restart all the things
8 - Repeat search for 'Genre/Form' and search matching term
9 - Record is returned

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Comment 6 Myka Kennedy Stephens 2019-12-31 01:11:27 UTC
(In reply to Nick Clemens from comment #4)
> 
> New patch attached, please retest

Patch worked as expected this time. Thanks, Nick!
Comment 7 Jonathan Druart 2020-01-02 11:41:02 UTC
Created attachment 96733 [details] [review]
Bug 24264: Use raw field when limiting by authtype

To test:
1 - Have a genre form record in your authorities file
2 - Search authorities for 'Default'
3 - The result is returned
4 - Set the dropdown to 'Genre/Form' and search matchign term
5 - No results
6 - Apply patch
7 - Restart all the things
8 - Repeat search for 'Genre/Form' and search matching term
9 - Record is returned

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Lucas Gass (lukeg) 2020-01-17 14:47:03 UTC
backported to 19.05.x for 19.05.07