Bug 36723 - Add musical presentation to Elasticsearch index mappings
Summary: Add musical presentation to Elasticsearch index mappings
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Danyon Sewell
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-30 04:40 UTC by Aleisha Amohia
Modified: 2024-05-30 19:26 UTC (History)
3 users (show)

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


Attachments
bug 36723: Add musical presentation to Elasticsearch index mappings (1.81 KB, patch)
2024-05-01 03:47 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (2.60 KB, patch)
2024-05-01 03:57 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (2.65 KB, patch)
2024-05-01 03:59 UTC, Danyon Sewell
Details | Diff | Splinter Review
Bug 36723: Add musical presentation to Elasticsearch index mappings (2.69 KB, patch)
2024-05-02 21:51 UTC, David Nind
Details | Diff | Splinter Review
Bug 36723: Add musical presentation to Elasticsearch index mappings (2.56 KB, patch)
2024-05-03 02:09 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (1.81 KB, patch)
2024-05-09 04:04 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (4.11 KB, patch)
2024-05-09 04:14 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (2.25 KB, patch)
2024-05-10 02:36 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (2.25 KB, patch)
2024-05-10 02:39 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (2.00 KB, patch)
2024-05-10 02:41 UTC, Danyon Sewell
Details | Diff | Splinter Review
bug 36723: Add musical presentation to Elasticsearch index mappings (2.05 KB, patch)
2024-05-10 03:26 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2024-04-30 04:40:25 UTC
https://www.loc.gov/marc/bibliographic/bd254.html
Comment 1 Danyon Sewell 2024-05-01 03:47:01 UTC
Created attachment 165938 [details] [review]
bug 36723: Add musical presentation to Elasticsearch index mappings
Comment 2 Danyon Sewell 2024-05-01 03:57:44 UTC
Created attachment 165940 [details] [review]
bug 36723: Add musical presentation to Elasticsearch index mappings

Have written a patch to allow Musical Presentation to be a search option within Elasticsearch index mappings

Test plan:

1. Apply this patch

2. Ensure MARC index 254 (Musical Presentation) is visible to edit on the default MARC bibliographic framework
   Koha Administration > MARC Bibliographic framework > Actions (under default framework) > MARC structure > Search 254 and actions->edit subfield > tick box for visibility should have OPAC, Staff Interface and Editor ticked.

3. Edit a record using the default MARC bibliographic framework and put a search term under index 254 and save.

4. Head back to the home page and go to Advanced Search

5. under the Search for dropdown select Musical presentation and in the search field enter the search term you used in step 3.

Your results should appear
Comment 3 Danyon Sewell 2024-05-01 03:59:19 UTC
Created attachment 165941 [details] [review]
bug 36723: Add musical presentation to Elasticsearch index mappings

Have written a patch to allow Musical Presentation to be a search option within Elasticsearch index mappings

Test plan:

1. Apply this patch

2. Ensure MARC index 254 (Musical Presentation) is visible to edit on the default MARC bibliographic framework
   Koha Administration > MARC Bibliographic framework > Actions (under default framework) > MARC structure > Search 254 and actions->edit subfield > tick box for visibility should have OPAC, Staff Interface and Editor ticked.

3. Edit a record using the default MARC bibliographic framework and put a search term under index 254 and save.

4. Head back to the home page and go to Advanced Search

5. under the Search for dropdown select Musical presentation and in the search field enter the search term you used in step 3.

Your results should appear

Sponsored-by: Education Services Australia SCIS
Comment 4 David Nind 2024-05-02 21:51:52 UTC
Created attachment 166091 [details] [review]
Bug 36723: Add musical presentation to Elasticsearch index mappings

Have written a patch to allow Musical Presentation to be a search option within Elasticsearch index mappings

Test plan:

1. Apply this patch

2. Ensure MARC index 254 (Musical Presentation) is visible to edit on the default MARC bibliographic framework
   Koha Administration > MARC Bibliographic framework > Actions (under default framework) > MARC structure > Search 254 and actions->edit subfield > tick box for visibility should have OPAC, Staff Interface and Editor ticked.

3. Edit a record using the default MARC bibliographic framework and put a search term under index 254 and save.

4. Head back to the home page and go to Advanced Search

5. under the Search for dropdown select Musical presentation and in the search field enter the search term you used in step 3.

Your results should appear

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-05-02 21:54:49 UTC
I made two minor changes to the patch:
1. Bug title: "Bug...." (Change to a capital B from b).
2. For the advanced search keyword title, I changed it to sentence case to match with all the others - Musical presentation.

I did note a couple of things, but I'm not sure whether these are in scope for this bug or are achieved some other way:
1. The 254$a is not displayed in the details page for the record on the staff interface and OPAC, even though it is set to visible. I assume that this requires updating something else.
2. The "Musical presentation" index does not appear as an option in the OPAC advanced search when 'More options' is selected. 

Testing notes using KTD:

1. Start up KTD with Elasticsearch: ktd --es8 up
2. Apply the patch and restart everything (restart_all).
3. Reset the mappings: Administration > Catalog > Search engine configuration (Elasticsearch) > Reset mappings (at the bottom of the page)
4. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
5. Alternative to steps 3 and 4: reset_all
6. Update the visibility for 254$a in the default framework so that it is visible in the Editor (OPAC, Staff interface should already be selected).
7. Add a new record using the default framework and put a term in 254$a, such as 'Full score'.
8. Use the advanced search. For the keyword indexes, 'Musical presentation' is now listed.
9. Search for the term you added for the record in step 6.
Comment 6 David Nind 2024-05-02 21:55:28 UTC
Added assignee
Comment 7 Danyon Sewell 2024-05-03 02:09:22 UTC
Created attachment 166093 [details] [review]
Bug 36723: Add musical presentation to Elasticsearch index mappings

Thanks for the minor changes David.

For your other two points noted:

1. I think that's a bit out of scope for this enhancement, all we're really wanting to do is add this particular index to the advanced search feature, what your suggesting i'd assume would require a change within the xslt.

2. You're absolutely right that's my mistake, I have updated that in this latest patch, hopefully that should be all that is required.

also going to copy your testing plan as it's much clearer than mine was :)

Testing plan:

1. Start up KTD with Elasticsearch: ktd --es8 up
2. Apply the patch and restart everything (restart_all).
3. Reset the mappings: Administration > Catalog > Search engine configuration (Elasticsearch) > Reset mappings (at the bottom of the page)
4. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
5. Alternative to steps 3 and 4: reset_all
6. Update the visibility for 254$a in the default framework so that it is visible in the Editor (OPAC, Staff interface should already be selected).
7. Add a new record using the default framework and put a term in 254$a, such as 'Full score'.
8. Use the advanced search. For the keyword indexes, 'Musical presentation' is now listed.
9. Search for the term you added for the record in step 6.
10. Do this for both the Opac and Staff Client.

Sponsored-by: Education Services Australia SCIS
Comment 8 Katrin Fischer 2024-05-06 07:30:24 UTC
Something is looking a little odd here:

1) I think some of the bugzilla comments ended up in the commit message. 
2) This advertises updating the mapping, but the patch actually adds a new entry  to the pull down in the OPAC. I think we are missing the previous patch: please note that patches with the exact same subject line will overwrite each other when uploaded to bugzilla. Be always specific and mark (follow-up) as such and describe what they are fixing.

Updating the mappings is a non-issue, but I feel this is a very specific field that will only be interesting for some libraries that have musical holdings. A lot of other libraries might ask to hide it. 

Maybe we could discuss separately how to handle this and limit the bug to the Elasticsearch mapping for now?
Comment 9 Katrin Fischer 2024-05-06 07:37:03 UTC
Another bigger issue why we should not add the pull-down: this index is not defined for Zebra at all and libraries using Elastic would need to update their mappings.
Comment 10 Danyon Sewell 2024-05-09 04:04:49 UTC Comment hidden (obsolete)
Comment 11 Danyon Sewell 2024-05-09 04:14:05 UTC Comment hidden (obsolete)
Comment 12 Danyon Sewell 2024-05-10 02:36:39 UTC Comment hidden (obsolete)
Comment 13 Danyon Sewell 2024-05-10 02:39:30 UTC Comment hidden (obsolete)
Comment 14 Danyon Sewell 2024-05-10 02:41:27 UTC
Created attachment 166486 [details] [review]
bug 36723: Add musical presentation to Elasticsearch index mappings

After discussing with my team this morning we agreed the best way forward given the insight from Katrin would be to only include the addition to the index mappings and leave the advanced search dropdown additions as a customization for our client who requested it, due to it being more of a niche enchancement. I have amended the patch to only include the changes to the Elasticsearch mappings.

Testing plan:

1. Start up KTD with Elasticsearch: ktd --es8 up
2. Apply the patch and restart everything (restart_all).
3. Reset the mappings: Administration > Catalog > Search engine configuration (Elasticsearch) > Reset mappings (at the bottom of the page)
4. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
5. Alternative to steps 3 and 4: reset_all
6. Update the visibility for 254$a in the default framework so that it is visible in the Editor (OPAC, Staff interface should already be selected).
7. Add a new record using the default framework and put a term in 254$a, such as 'Full score'.

Sponsored-by: Education Services Australia SCIS
Comment 15 David Nind 2024-05-10 03:26:06 UTC
Created attachment 166487 [details] [review]
bug 36723: Add musical presentation to Elasticsearch index mappings

After discussing with my team this morning we agreed the best way forward given the insight from Katrin would be to only include the addition to the index mappings and leave the advanced search dropdown additions as a customization for our client who requested it, due to it being more of a niche enchancement. I have amended the patch to only include the changes to the Elasticsearch mappings.

Testing plan:

1. Start up KTD with Elasticsearch: ktd --es8 up
2. Apply the patch and restart everything (restart_all).
3. Reset the mappings: Administration > Catalog > Search engine configuration (Elasticsearch) > Reset mappings (at the bottom of the page)
4. Reindex: koha-elasticsearch --rebuild -d -b -a kohadev
5. Alternative to steps 3 and 4: reset_all
6. Update the visibility for 254$a in the default framework so that it is visible in the Editor (OPAC, Staff interface should already be selected).
7. Add a new record using the default framework and put a term in 254$a, such as 'Full score'.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2024-05-10 03:27:40 UTC
Testing notes (using KTD):

1. Can search on the index in the search field using musical-presentation, for example: musical-presentation:score
Comment 17 Katrin Fischer 2024-05-13 11:58:17 UTC
This is the previous patch, but with parts removed. Moving to PQA directly.
Comment 18 Katrin Fischer 2024-05-13 12:02:39 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 19 Fridolin Somers 2024-05-29 12:30:18 UTC
Easy small enhancement, backported

Pushed to 23.11.x for 23.11.06
Comment 20 Lucas Gass 2024-05-30 19:26:42 UTC
Trivial patch, choosing to backport to 23.05.x for upcoming 23.05.x