Bug 36396 - Link facet with authorised value category
Summary: Link facet with authorised value category
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 35138
Blocks: 36398
  Show dependency treegraph
 
Reported: 2024-03-22 09:13 UTC by Jonathan Druart
Modified: 2024-09-09 21:28 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/953
Text to go in the release notes:
This new feature adds the ability to link an Elasticsearch facet to an authorized value category in order to display a description instead of the code. An example could be a code for the resource type (book, e-journal, database, etc.) if this code is in a local MARC 9xx field. This feature depends on Bug 35138 - configuration of facets with Elasticsearch.
Version(s) released in:
24.05.00
Circulation function:


Attachments
Bug 36396: DB changes (1.91 KB, patch)
2024-03-22 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: DBIC schema changes (1.58 KB, patch)
2024-03-22 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: Link facet with authorised value category - ES (11.03 KB, patch)
2024-03-22 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: Prevent link to av for 'specials' (3.45 KB, patch)
2024-03-22 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: UI - OPAC (5.40 KB, patch)
2024-03-22 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: Export/import the yaml config (2.50 KB, patch)
2024-03-22 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: (follow-up) Prevent link to av for 'specials' (1.95 KB, patch)
2024-03-22 13:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: DB changes (1.96 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: DBIC schema changes (1.63 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: Link facet with authorised value category - ES (11.07 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: Prevent link to av for 'specials' (3.49 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: UI - OPAC (5.45 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: Export/import the yaml config (2.55 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: (follow-up) Prevent link to av for 'specials' (2.00 KB, patch)
2024-03-25 10:10 UTC, Lukas Koszyk
Details | Diff | Splinter Review
Bug 36396: DB changes (2.05 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: DBIC schema changes (1.69 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: Link facet with authorised value category - ES (11.15 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: Prevent link to av for 'specials' (4.42 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: UI - OPAC (5.52 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: Export/import the yaml config (2.61 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: (follow-up) Prevent link to av for 'specials' (2.07 KB, patch)
2024-05-07 10:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36396: Add tests (3.77 KB, patch)
2024-05-07 10:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36396: Add tests (3.83 KB, patch)
2024-05-07 11:11 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-03-22 09:13:52 UTC
In order to display descriptions instead of codes we will add a link to an authorised value category.
Comment 1 Jonathan Druart 2024-03-22 10:36:08 UTC
Created attachment 163685 [details] [review]
Bug 36396: DB changes

Add the new DB column search_field.authorised_value_category

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 2 Jonathan Druart 2024-03-22 10:36:10 UTC
Created attachment 163686 [details] [review]
Bug 36396: DBIC schema changes

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 3 Jonathan Druart 2024-03-22 10:36:13 UTC
Created attachment 163687 [details] [review]
Bug 36396: Link facet with authorised value category - ES

This new feature adds the ability to link an ES facet to an authorised
value category, in order to display a description instead of the code.

Test plan:
1. Go to the ES mapping admin page
2. Notice the new "Authorized value category" column in the facets
   config table
3. Create a new facet that is linked to a search field containing values
   from an authorised value category. Pick this category in the list
4. Save
5. Reindex
6. Notice that the descriptions are now displayed (staff and OPAC) in
   the search result page.

QA: See the related bug report for possible improvements. It's not
easy at all to deal with the "specials" here, a lot of changes must be
done in how we fetch/cache the AVs.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 4 Jonathan Druart 2024-03-22 10:36:15 UTC
Created attachment 163688 [details] [review]
Bug 36396: Prevent link to av for 'specials'

See previous commit message, 'QA' part.
We do not support the "specials" categories.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 5 Jonathan Druart 2024-03-22 10:36:17 UTC
Created attachment 163689 [details] [review]
Bug 36396: UI - OPAC

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 6 Jonathan Druart 2024-03-22 10:36:19 UTC
Created attachment 163690 [details] [review]
Bug 36396: Export/import the yaml config

Test plan:
Export the ES fields/mappings using
 misc/search_tools/export_elasticsearch_mappings.pl > mappings.yaml
Copy this file to admin/searchengine/elasticsearch/mappings.yaml

Reset the mapping from the UI
Notice that the links to the AV categories have been preserved

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Comment 7 Michaela Sieber 2024-03-22 13:31:26 UTC
Thanks Jonathan!

Just a very small thing:
 When adding a new line to the facets config table 'Facet order' it is not possible to leave the authorised value category empty. You first have to add the line and save, afterwards you can change the authorised value category to be empty.
Comment 8 Jonathan Druart 2024-03-22 13:37:35 UTC
Created attachment 163705 [details] [review]
Bug 36396: (follow-up) Prevent link to av for 'specials'
Comment 9 Jonathan Druart 2024-03-22 13:38:20 UTC
(In reply to Michaela Sieber from comment #7)
> Thanks Jonathan!
> 
> Just a very small thing:
>  When adding a new line to the facets config table 'Facet order' it is not
> possible to leave the authorised value category empty. You first have to add
> the line and save, afterwards you can change the authorised value category
> to be empty.

Indeed, thanks! Should be fixed now.
Comment 10 Lukas Koszyk 2024-03-25 10:10:42 UTC
Created attachment 163776 [details] [review]
Bug 36396: DB changes

Add the new DB column search_field.authorised_value_category

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 11 Lukas Koszyk 2024-03-25 10:10:44 UTC
Created attachment 163777 [details] [review]
Bug 36396: DBIC schema changes

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 12 Lukas Koszyk 2024-03-25 10:10:47 UTC
Created attachment 163778 [details] [review]
Bug 36396: Link facet with authorised value category - ES

This new feature adds the ability to link an ES facet to an authorised
value category, in order to display a description instead of the code.

Test plan:
1. Go to the ES mapping admin page
2. Notice the new "Authorized value category" column in the facets
   config table
3. Create a new facet that is linked to a search field containing values
   from an authorised value category. Pick this category in the list
4. Save
5. Reindex
6. Notice that the descriptions are now displayed (staff and OPAC) in
   the search result page.

QA: See the related bug report for possible improvements. It's not
easy at all to deal with the "specials" here, a lot of changes must be
done in how we fetch/cache the AVs.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 13 Lukas Koszyk 2024-03-25 10:10:49 UTC
Created attachment 163779 [details] [review]
Bug 36396: Prevent link to av for 'specials'

See previous commit message, 'QA' part.
We do not support the "specials" categories.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 14 Lukas Koszyk 2024-03-25 10:10:51 UTC
Created attachment 163780 [details] [review]
Bug 36396: UI - OPAC

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 15 Lukas Koszyk 2024-03-25 10:10:53 UTC
Created attachment 163781 [details] [review]
Bug 36396: Export/import the yaml config

Test plan:
Export the ES fields/mappings using
 misc/search_tools/export_elasticsearch_mappings.pl > mappings.yaml
Copy this file to admin/searchengine/elasticsearch/mappings.yaml

Reset the mapping from the UI
Notice that the links to the AV categories have been preserved

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 16 Lukas Koszyk 2024-03-25 10:10:56 UTC
Created attachment 163782 [details] [review]
Bug 36396: (follow-up) Prevent link to av for 'specials'

Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Comment 17 Katrin Fischer 2024-04-30 09:17:47 UTC
With bug 35138 being pushed today, this would make a lot of sense to "round off" the feature for this release.
Comment 18 Martin Renvoize (ashimema) 2024-05-07 10:21:25 UTC
Created attachment 166246 [details] [review]
Bug 36396: DB changes

Add the new DB column search_field.authorised_value_category

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 19 Martin Renvoize (ashimema) 2024-05-07 10:21:28 UTC
Created attachment 166247 [details] [review]
Bug 36396: DBIC schema changes

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Martin Renvoize (ashimema) 2024-05-07 10:21:31 UTC
Created attachment 166248 [details] [review]
Bug 36396: Link facet with authorised value category - ES

This new feature adds the ability to link an ES facet to an authorised
value category, in order to display a description instead of the code.

Test plan:
1. Go to the ES mapping admin page
2. Notice the new "Authorized value category" column in the facets
   config table
3. Create a new facet that is linked to a search field containing values
   from an authorised value category. Pick this category in the list
4. Save
5. Reindex
6. Notice that the descriptions are now displayed (staff and OPAC) in
   the search result page.

QA: See the related bug report for possible improvements. It's not
easy at all to deal with the "specials" here, a lot of changes must be
done in how we fetch/cache the AVs.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 21 Martin Renvoize (ashimema) 2024-05-07 10:21:34 UTC
Created attachment 166249 [details] [review]
Bug 36396: Prevent link to av for 'specials'

See previous commit message, 'QA' part.
We do not support the "specials" categories.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 22 Martin Renvoize (ashimema) 2024-05-07 10:21:37 UTC
Created attachment 166250 [details] [review]
Bug 36396: UI - OPAC

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 23 Martin Renvoize (ashimema) 2024-05-07 10:21:40 UTC
Created attachment 166251 [details] [review]
Bug 36396: Export/import the yaml config

Test plan:
Export the ES fields/mappings using
 misc/search_tools/export_elasticsearch_mappings.pl > mappings.yaml
Copy this file to admin/searchengine/elasticsearch/mappings.yaml

Reset the mapping from the UI
Notice that the links to the AV categories have been preserved

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 24 Martin Renvoize (ashimema) 2024-05-07 10:21:43 UTC
Created attachment 166252 [details] [review]
Bug 36396: (follow-up) Prevent link to av for 'specials'

Signed-off-by: Lukas Koszyk <lukasz.koszyk@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 25 Martin Renvoize (ashimema) 2024-05-07 10:22:37 UTC
This looks pretty good and works.. but we're missing unit tests for the additional functionality introduced into the Koha:: modules.
Comment 26 Jonathan Druart 2024-05-07 10:41:52 UTC
Created attachment 166254 [details] [review]
Bug 36396: Add tests
Comment 27 Martin Renvoize (ashimema) 2024-05-07 11:11:33 UTC
Created attachment 166258 [details] [review]
Bug 36396: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 28 Martin Renvoize (ashimema) 2024-05-07 11:11:52 UTC
Nice one Jonathan,

Passing QA
Comment 29 Katrin Fischer 2024-05-07 13:56:12 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 30 Fridolin Somers 2024-05-24 14:30:20 UTC
Depends on Bug 35138 not in 23.11.x