To replicate: 1. Create a topic term authority "Example" 2. Duplicate that authority so there are two 3. Find a record and add the topical term "Example" 4. Link the topical term in the record to one of the two Example authorities. 5. Set OPACShowUnusedAuthorities to show. 6. Ensure OpacAuthorities is set to Allow. 7. Search Authorities in the OPAC for "Example" A list should be returned with Example listed twice. One of the authorities should display it is linked to a record and one should be "0" for no link. 8. Change OPACShowUnusedAuthorities to don't show 9. Refresh the page and repeat the authority search for "Example" See that the search results are identical. The Example result with no linked records still displays. I would have expected it to not display, unless there is some other preference or option that needs to be set.
That would be from bug 12478 in https://git.koha-community.org/Koha-community/Koha/commit/0002bbc72a42b4c4223e20c66ef032c20f48ba19 - apparently at one point, Elasticsearch hadn't yet implemented authority usage counts, so they just commented out the whole OPACShowUnusedAuthorities feature for ES and Zebra, and left it that way.
Created attachment 167629 [details] [review] Bug 37057: Restore filtering of unused authorities Bug 12478 commented this code out, however, we do return the 'used' parameter in ES authority searches. While we should implement the feature for both ES and Zebra as an index, we can restore this behaviour here. To test: 1 - Search authorities on OPAC with SearchEngine syspref set to both Elasticsearch and Zebra I just searched for 'a' 2 - Confirm results with no usage are included 3 - Test with both values of OPACShowUnusedAuthorities 4 - Apply patch 5 - Repeat searches with both engines and syspref settings 6 - Confirm unused authorities not shown in either engine when syspref is "Don't show" 7 - Conifrm unused authorities shown in both engines when syspref is "Show"
Created attachment 167705 [details] [review] Bug 37057: Restore filtering of unused authorities Bug 12478 commented this code out, however, we do return the 'used' parameter in ES authority searches. While we should implement the feature for both ES and Zebra as an index, we can restore this behaviour here. To test: 1 - Search authorities on OPAC with SearchEngine syspref set to both Elasticsearch and Zebra I just searched for 'a' 2 - Confirm results with no usage are included 3 - Test with both values of OPACShowUnusedAuthorities 4 - Apply patch 5 - Repeat searches with both engines and syspref settings 6 - Confirm unused authorities not shown in either engine when syspref is "Don't show" 7 - Conifrm unused authorities shown in both engines when syspref is "Show" Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. I used the word 'central' to show used and unused terms on the search results. 2. The pagination for OPAC authority search results is currently not working (not because of this bug). If you try and navigate to the next page of results, it just returns you to the authority search form. I have logged Bug 37086 for this.
Created attachment 168271 [details] [review] Bug 37057: Restore filtering of unused authorities Bug 12478 commented this code out, however, we do return the 'used' parameter in ES authority searches. While we should implement the feature for both ES and Zebra as an index, we can restore this behaviour here. To test: 1 - Search authorities on OPAC with SearchEngine syspref set to both Elasticsearch and Zebra I just searched for 'a' 2 - Confirm results with no usage are included 3 - Test with both values of OPACShowUnusedAuthorities 4 - Apply patch 5 - Repeat searches with both engines and syspref settings 6 - Confirm unused authorities not shown in either engine when syspref is "Don't show" 7 - Conifrm unused authorities shown in both engines when syspref is "Show" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thanks for the quick fix Nick.. all working as expected again now. Passing QA
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.06
Pushed to 23.11.x for 23.11.11