Summary: | Elasticsearch - add support for 'year' fields | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Searching - Elasticsearch | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | aspencatteam, black23, julian.maurice, mkstephens |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24807 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 24559: Add 'year' type to Elasticsearch
Bug 24559: Database update Bug 24559: Add 'year' type to Elasticsearch Bug 24559: Database update |
Description
Nick Clemens (kidclamp)
2020-01-31 18:30:01 UTC
If sort by publication date is not working, it should probably not be an option. It is a nice option so it would be good to have fixed. When results return more records than are easily reviewed it is nice to be able to sort either alphabetical by title (which is also not working) or publication date. Created attachment 99626 [details] [review] Bug 24559: Add 'year' type to Elasticsearch When indexing fields like 260c or 008_/7-10 we need a way to format these 'date' fields into years. Removing punctuation and coverting unknown values to 0 To test: 1 - Edit some records to have dates of publication in 008 like 202u 2021 203u 2039 2 - Also add to title for all records a unique word like 'octoparrot' 3 - Search for 'octoparrot' 4 - Sort records by publication/copyrightdate 5 - Confirm sorting is not as expected 6 - Apply patch 7 - Set copydate to 'year' type 8 - Reindex 9 - Repeat search 10 - Confirm sorting works as expected Nick, I'm getting this error when I try to change copydate to Year: An error occurred when updating mappings: DBIx::Class::Storage::DBI::_dbh_execute(): Data truncated for column 'type' at row 1 at /kohadevbox/koha/Koha/Object.pm line 156 . How do I fix that? (and how on earth did you come up with octoparrot??) Created attachment 99785 [details] [review] Bug 24559: Database update (In reply to Myka Kennedy Stephens from comment #3) > Nick, I'm getting this error when I try to change copydate to Year: > An error occurred when updating mappings: > DBIx::Class::Storage::DBI::_dbh_execute(): Data truncated for column 'type' > at row 1 at /kohadevbox/koha/Koha/Object.pm line 156 . > > How do I fix that? (and how on earth did you come up with octoparrot??) Hah, you need the update I didn't attach It's a Simpsons joke: https://giphy.com/gifs/season-12-the-simpsons-12x9-3orifddyIN9i0I9tp6 "polly shouldn't be" Created attachment 99791 [details] [review] Bug 24559: Add 'year' type to Elasticsearch When indexing fields like 260c or 008_/7-10 we need a way to format these 'date' fields into years. Removing punctuation and coverting unknown values to 0 To test: 1 - Edit some records to have dates of publication in 008 like 202u 2021 203u 2039 2 - Also add to title for all records a unique word like 'octoparrot' 3 - Search for 'octoparrot' 4 - Sort records by publication/copyrightdate 5 - Confirm sorting is not as expected 6 - Apply patch 7 - Set copydate to 'year' type 8 - Reindex 9 - Repeat search 10 - Confirm sorting works as expected Nice work, Nick. Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 99792 [details] [review] Bug 24559: Database update Signed-off-by: Michal Denar <black23@gmail.com> *** Bug 25378 has been marked as a duplicate of this bug. *** |