Bugzilla – Attachment 173716 Details for
Bug 36437
Add publication year facet to Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36437: add pub year facet to Elasticsearch
Bug-36437-add-pub-year-facet-to-Elasticsearch.patch (text/plain), 6.23 KB, created by
Michał
on 2024-10-30 13:14:13 UTC
(
hide
)
Description:
Bug 36437: add pub year facet to Elasticsearch
Filename:
MIME Type:
Creator:
Michał
Created:
2024-10-30 13:14:13 UTC
Size:
6.23 KB
patch
obsolete
>From f9e2c91a3d1e164bdc2d89ab3c36537281b03952 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20Kula?= > <148193449+mkibp@users.noreply.github.com> >Date: Wed, 30 Oct 2024 13:09:54 +0000 >Subject: [PATCH] Bug 36437: add pub year facet to Elasticsearch > >Notes: >- I labeled it as "Year of publication" instead of "Date of publication" since it seems to be more occurate (since the field is a year and that's gonna be better to translate to other langauge) >- the third word is not capitalized, since I'm following the naming convention of existing facet labels >- facet_order was set to 3, since that should be a pretty common field and useful to display high up to get a quick idea for the range of years the results are from > >Test plan: >0. Ensure Elasticsearch index is rebuilt (should be on fresh ktd startup?) >1. On intranet go to /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl >2. Go to second tab there >3. Ensure date-of-publication is in the table, has label in parentheses, has facetable set to Yes >4. Scrolldown to the order of facets table >5. Ensure date-of-publication is there, has label, is third on the list >6. Search for something in intranet, ensure the facet is visible, its value is year, it's clickable and working >7. Search for something in OPAC, as above ensure it works (important to check both OPAC and intranet since facets use different templates to display in both...) >--- > .../searchengine/elasticsearch/mappings.yaml | 21 ++++++++++--------- > .../intranet-tmpl/prog/en/includes/facets.inc | 2 ++ > .../searchengine/elasticsearch/mappings.tt | 1 + > .../bootstrap/en/includes/opac-facets.inc | 2 ++ > 4 files changed, 16 insertions(+), 10 deletions(-) > >diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml >index f1bfdbe916..302418d41e 100644 >--- a/admin/searchengine/elasticsearch/mappings.yaml >+++ b/admin/searchengine/elasticsearch/mappings.yaml >@@ -1341,7 +1341,7 @@ biblios: > staff_client: 1 > type: '' > ccode: >- facet_order: 7 >+ facet_order: 8 > label: Collections > mandatory: ~ > mappings: >@@ -1717,15 +1717,16 @@ biblios: > staff_client: 1 > type: date > date-of-publication: >- label: date-of-publication >+ facet_order: 3 >+ label: Year of publication > mandatory: ~ > mappings: >- - facet: '' >+ - facet: 1 > marc_field: 008_/7-10 > marc_type: marc21 > sort: 1 > suggestible: '' >- - facet: '' >+ - facet: 1 > marc_field: 100a_/9-12 > marc_type: unimarc > sort: 1 >@@ -1935,7 +1936,7 @@ biblios: > suggestible: '' > type: geo_point > holdingbranch: >- facet_order: 8 >+ facet_order: 9 > label: Holding libraries > mandatory: ~ > mappings: >@@ -1953,7 +1954,7 @@ biblios: > staff_client: 1 > type: string > homebranch: >- facet_order: 9 >+ facet_order: 10 > label: Home libraries > mandatory: ~ > mappings: >@@ -2607,7 +2608,7 @@ biblios: > staff_client: 1 > type: '' > ln: >- facet_order: 10 >+ facet_order: 11 > label: Languages > mandatory: ~ > mappings: >@@ -2693,7 +2694,7 @@ biblios: > staff_client: 1 > type: number > location: >- facet_order: 3 >+ facet_order: 4 > label: Location > mandatory: ~ > mappings: >@@ -3531,7 +3532,7 @@ biblios: > staff_client: 1 > type: '' > su-geo: >- facet_order: 4 >+ facet_order: 5 > label: Places > mandatory: ~ > mappings: >@@ -4311,7 +4312,7 @@ biblios: > staff_client: 1 > type: '' > title-series: >- facet_order: 5 >+ facet_order: 6 > label: Series > mandatory: ~ > mappings: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc >index 2e54fcb523..0081005f46 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc >@@ -55,6 +55,8 @@ > <span id="facet-authors">Authors</span> > [% CASE 'Titles' %] > <span id="facet-titles">Titles</span> >+ [% CASE 'Year of publication' %] >+ <span id="facet-year-of-publication">Year of publication</span> > [% CASE 'Topics' %] > <span id="facet-topics">Topics</span> > [% CASE 'Places' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >index 2f3d4f0417..ae39f534df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >@@ -516,6 +516,7 @@ a.add, a.delete { > [% SWITCH f.label %] > [% CASE 'Authors' %]<span>Authors</span> > [% CASE 'Item types' %]<span>Item types</span> >+ [% CASE 'Year of publication' %]<span>Year of publication</span> > [% CASE 'Locations' %]<span>Locations</span> > [% CASE 'Places' %]<span>Places</span> > [% CASE 'Series' %]<span>Series</span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >index b133c530f8..7d89d61594 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >@@ -47,6 +47,8 @@ > <h3 id="facet-authors">Authors</h3> > [% CASE 'Titles' %] > <h3 id="facet-titles">Titles</h3> >+ [% CASE 'Year of publication' %] >+ <h3 id="facet-year-of-publication">Year of publication</h3> > [% CASE 'Topics' %] > <h3 id="facet-topics">Topics</h3> > [% CASE 'Places' %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36437
:
163976
| 173716