Bug 38741

Summary: define a secondary sort order for searches where primary sort field matches for several results
Product: Koha Reporter: Jake Bateman <jake.bateman>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: helm.consortium
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23875
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Jake Bateman 2024-12-18 12:21:00 UTC
When several search results are returned whose relevance and defaultSortOrder field match (a series with many volumes with the same publication date, in my case), it would be desirable to have these results ordered by some deliberately chosen field, or by a sensible default (title alphanumeric desc would I think would be correct in all cases, potentially negating the need for an additional syspref). In my testing (with Elasticsearch), I believe the current secondary sort order to be [biblionumber asc, plus some randomness from a race condition introduced by the multiple concurrent processing threads used by the Elasticsearch reindex task, if multithreading was used].
Comment 1 Jake Bateman 2024-12-19 09:55:27 UTC
screenshots of an example search with records in semi-random but almost biblionumber order

https://imgbox.com/muwIxR4O
https://imgbox.com/TO0X2pYG
Comment 2 Katrin Fischer 2024-12-19 21:15:05 UTC
I thought we had fixed the biblionumber not sorting numerical... but maybe not? I remember the intention to use it as the second sort criteria and I think we would like that as an option at least. It would allow to put the newest (highest biblionumber) first.

Which version are you testing with?

There is also:
Bug 23875 - Elasticsearch - When sorting by score we should provide a tiebreaker