Bug 36437 - Add publication year facet to Elasticsearch
Summary: Add publication year facet to Elasticsearch
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Michał
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-27 08:00 UTC by Michał
Modified: 2024-03-28 03:02 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
0001-Bug-36437-Add-publication-year-facet-to-Elasticsearc.patch (10.70 KB, patch)
2024-03-27 08:03 UTC, Michał
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Michał 2024-03-27 08:00:35 UTC
Similarly to Bug 18213, it'd be nice to add publication date facet. It seems to work quite nicely, so why not? Our librarians say it's super useful.

I've seen one library implement it in their fork, the only difference is that they sort the publication year facet in reverse incremental order (so from newest to oldest year instead of oldest to newest), but I think this would require an explicit check in the code, and I wasn't sure if that'd be fine...

To test, one should have Elasticsearch enabled and re-generate the mappings from file and reindex as described in Bug 18213.

Then confirm that the facet is visible and working:
- in OPAC search
- in intranet search
- in intranet settings, under Elasticsearch mapping settings page, biblio tab, publication year facet should be visible at the bottom where you set facet order, with correct label; you should be able to change the order normally as expected
Comment 1 Michał 2024-03-27 08:03:28 UTC
Created attachment 163976 [details] [review]
0001-Bug-36437-Add-publication-year-facet-to-Elasticsearc.patch
Comment 2 Jonathan Druart 2024-03-27 08:44:56 UTC
Hey, did you see bug 35138?
Comment 3 Michał 2024-03-27 09:11:12 UTC
Oh, I didn't. Honestly if they want to make facets configurable in the UI instead of hardcoding them in several places, then that's only for the better. Then that'd obsolete this bug and afterwards we could only argue for including the publication year on by default perhaps... (whether as this bug or by Bug 10734 and marking that one as solved and this one as not applying...)
Comment 4 Jonathan Druart 2024-03-27 12:39:24 UTC
It could still be added to the default but in my opinion the patch should be written on top of bug 35138.