[Bug 43436] New: Elasticsearch doesn't order publication dates with 'u' correctly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 Bug ID: 43436 Summary: Elasticsearch doesn't order publication dates with 'u' correctly Initiative type: --- Sponsorship --- status: Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org Target Milestone: --- In MARC21, but also in UNIMARC as was mentioned on Mattermost, sorting by publication date doesn't work correctly. We use date-of-publication for sorting. In MARC21 this contains the information from 008, 4-10 (Date 1). These dates are fixed on 4 characters and can contain u for unknown parts of the date: 0201 1999 07uu We noticed this while working on a project that has a lot of manuscripts that can date back to before 1000 and have some uncertainty. The 07uu will sort as 7, which puts it off by a few hundred years. I experimented with the "Call number" type in the configuration as that has a sort configuration of "numerical: false". The results appear to be much better then. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- "Call number" was a red hering it seems, but in general I think we might get better results with a non-numerical, alphabetic sorting here. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Using type "year" (that I only found now by Nick's hint) seems to work better. The default configuration uses Standary or type: "" for date-of-publication. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24807 CC| |nick@bywatersolutions.com --- Comment #3 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- See bug 24807 for discussion on the 'u' dates So do we just need to update the default mappings for date-of-publication to 'year'? Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24807 [Bug 24807] Add "year" type to improve sorting by publication date -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Academy Summary|Elasticsearch doesn't order |Update Elasticsearch |publication dates with 'u' |default mappings to use |correctly |'year' type for | |date-of-publication --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Nick Clemens (kidclamp) from comment #3)
See bug 24807 for discussion on the 'u' dates
So do we just need to update the default mappings for date-of-publication to 'year'?
In my tests that seems to fix the issue nicely - so yes, I think that's the missing piece. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|24.11 |Main Assignee|koha-bugs@lists.koha-commun |katrin.fischer@bsz-bw.de |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 211651 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211651&action=edit Bug 43436: Update default mappings to use type year for date-of-publication index Bug 24807 added type "year" for indexes to help handle days with with "u" in them correctly. With this type the sorting by year in the result list will work correctly for dates like "19uu" or "07uu" in 008 4-10 (Date 1). To test: - Make sure your instance is using Elasticsearch. - Edit some records to include years below 1000 and dates using 'u' in your result list. - Verify that results don't sort correctly. Example: 07uu will sort as 7, instead of 700. - Apply patch - Reset mappings and reindex - Verify sorting now works! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211651|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 212481 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212481&action=edit Bug 43436: Update default mappings to use type year for date-of-publication index Bug 24807 added type "year" for indexes to help handle days with with "u" in them correctly. With this type the sorting by year in the result list will work correctly for dates like "19uu" or "07uu" in 008 4-10 (Date 1). To test: - Make sure your instance is using Elasticsearch. - Edit some records to include years below 1000 and dates using 'u' in your result list. - Verify that results don't sort correctly. Example: 07uu will sort as 7, instead of 700. - Apply patch - Reset mappings and reindex - Verify sorting now works! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43436 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #7 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. I changed the details (008, position 07-10 - Date 1) for these three records, searched for perl, and changed the sort order to "Publication/Copyright date: oldest to newest" (and the reverse): - Programming Perl: 0201 - Higher-order Perl: 1999 - Intermediate Perl: 07uu 2. Before the patch, sorting oldest to newest: - Intermediate Perl: 07uu - Programming Perl: 0201 - Higher-order Perl: 1999 3. After the patch, mappings reset, and re-indexed: - Programming Perl: 0201 - Intermediate Perl: 07uu - Higher-order Perl: 1999 4. Reindexing: koha-elasticsearch --rebuild -d -b -a kohadev -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org