Summary: | Authority detail page shows wrong number of records using the authority | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Searching - Elasticsearch | Assignee: | Bugs List <koha-bugs> |
Status: | Failed QA --- | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | david, m.de.rooy, magnus |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20615 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: | Bug 30641: Quote authority id search |
Description
Katrin Fischer
2022-04-28 12:06:09 UTC
Ok, getting closer: The number on results and detail page match and are correct if AutoQueryTruncate is deactivated. And Elasticsearch is used. Cant directly reproduce this under Zebra. I am inclined to think that it is related to Elastic search engine module. Please confirm. Did you work under Elastic? Would be nice if we just used ->get_usage_count doing something like simple_search_compat( 'an:' . $authid, 0, 0 ) The other call goes (under Zebra) via SearchAuthorities. Hi Marcel, our investigation overlapped. The key factors are: Searchengine Elasticsearch AutoQueryTruncate ON (automatic truncation) The problematic one is get_usage_count - I found this while testing bug 20615 that uses it and shows the wrong number. Not sure what the result page does different... but it probably should all end up using the same and working code. Created attachment 134260 [details] [review] Bug 30641: Quote authority id search (In reply to Nick Clemens from comment #6) > Created attachment 134260 [details] [review] [review] > Bug 30641: Quote authority id search Not sure if you should solve it here. Elastic ? (In reply to Katrin Fischer from comment #5) > The problematic one is get_usage_count - I found this while testing bug > 20615 that uses it and shows the wrong number. Not sure what the result page > does different... but it probably should all end up using the same and > working code. No, it is just a wrapper to SearchEngine code. Marcel, can you explain the issue? We don't want to disable auto-truncate in general, so using "" like I think we have done in other places already makes sense to me. Nick, there is another query in Authorities.pm with an an-based search, maybe we should also fix that one? ... and we'll probably need a unit test Looks like that Zebra has no problem with the an:"9" since it is a :w index in MARC21. In UNIMARC it is both :n and :w. But Zebra does not need it; SimpleSearch does not add the asterisks for truncation. Apparently, Elastic does because QueryBuilder is adding asterisks. Looks to me that this is actually a more general problem: Elastic's simple_search_compat is not 'simple' enough ;) The quotes are a workaround. Note: We are forming queries like an:1 in more places in code. (In reply to Katrin Fischer from comment #10) > ... and we'll probably need a unit test Should this be "Failed QA" then? (In reply to Magnus Enger from comment #12) > (In reply to Katrin Fischer from comment #10) > > ... and we'll probably need a unit test > > Should this be "Failed QA" then? |