| Summary: | Elasticsearch sort by popularity must use totalissues search field | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
| Component: | Searching - Elasticsearch | Assignee: | Fridolin Somers <fridolin.somers> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | nick |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: | Bug 27206: Elasticsearch sort by popularity must use totalissues search field | ||
|
Description
Fridolin Somers
2020-12-11 14:33:41 UTC
Created attachment 114344 [details] [review] Bug 27206: Elasticsearch sort by popularity must use totalissues search field With Zebra search engine, sort by popularity uses search field 9003. This is from bib1.att : att 9003 totalissues 'totalissues' beeing on 942$0 Actually Elasticsearch sort by popularity uses search field 'issues' : https://git.koha-community.org/Koha-community/Koha/src/commit/cae0ef76f398bb3d9f60235ff10611cc8d8eacb7/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm#L593 Test plan : 1) Use zebra search engine 2) Perform some checkouts and checkins 3) Run misc/cronjobs/update_totalissues.pl 4) Perform a search sorting on popularity 5) Change search engine to Elasticsearch 6) Rebuild all biblios : misc/search_tools/rebuild_elasticsearch.pl -b 7) Perform same search sorting on popularity => You should get same order Elastic uses the sum of the 'issues' field which is set to the default of '952l' - so it should match the output when the totalissues field is counted using items. If you want it to match totalissues using statistics table, then we could map it to 942$0 Using the sum of the issues from items means we don't rely on the cronjob to update_totalissues which is maybe a good thing? (In reply to Nick Clemens from comment #2) > Elastic uses the sum of the 'issues' field which is set to the default of > '952l' - so it should match the output when the totalissues field is counted > using items. Ah sure. But I don't see where Elastic does this sum ? (In reply to Fridolin Somers from comment #3) > (In reply to Nick Clemens from comment #2) > > Elastic uses the sum of the 'issues' field which is set to the default of > > '952l' - so it should match the output when the totalissues field is counted > > using items. > Ah sure. > But I don't see where Elastic does this sum ? https://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=Koha/SearchEngine/Elasticsearch.pm;h=4a2d75d03decd5413ceb1969601d561ae8251f3f;hb=HEAD#l645 Ohhhh thanks a lot. Field issues is indeed type sum. This is for the best ;) I mark this as invalid. |