Bug 29724

Summary: Different authority usage count
Product: Koha Reporter: Filipe Ribeiro <fribeiro>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P5 - low CC: fridolin.somers
Version: 21.05   
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:

Description Filipe Ribeiro 2021-12-17 16:07:42 UTC
When searching for authorities, in the results table, the column "Used in" contains a different value from the counter shown at the details page of that authority.

The first count comes from https://github.com/Koha-Community/Koha/blob/v21.05.07/Koha/SearchEngine/Elasticsearch/Search.pm#L263

The second one comes from https://github.com/Koha-Community/Koha/blob/v21.05.07/Koha/Authorities.pm#L55

This last subroutine may return an incorrect value because the querybuilder adds a * at the end. Eg. "query": "(koha-auth-number:722*)"

Maybe we can replace simple_search_compat with count_auth_use
Comment 1 Fridolin Somers 2021-12-18 07:23:04 UTC
Indeed its a bug.

Already reported in Bug 26608

*** This bug has been marked as a duplicate of bug 26608 ***
Comment 2 Fridolin Somers 2021-12-18 07:23:28 UTC
Thanks for this report.

Best regards,