Bug 31887

Summary: Search on MARC field does not work in Elasticsearch mappings table
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: System AdministrationAssignee: Fridolin Somers <fridolin.somers>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: gmcharlt, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32519
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Attachments: Bug 31887: Fix search on MARC field in Elasticsearch mappings table
Bug 31887: Fix search on MARC field in Elasticsearch mappings table
Bug 31887: Fix search on MARC field in Elasticsearch mappings table

Description Fridolin Somers 2022-10-20 08:10:41 UTC
In Elasticsearch mappings table, in tabs with MARC fields, searching using DataTable search field does not work for MARC fields / subfields.
This is because cell contains an input HTML tag with MARC data in attribute value.
Comment 1 Fridolin Somers 2022-10-20 08:12:37 UTC
I think we must define attribute data-search in each cell : 
https://datatables.net/examples/advanced_init/html5-data-attributes
Comment 2 Fridolin Somers 2022-10-20 08:19:30 UTC
Created attachment 142229 [details] [review]
Bug 31887: Fix search on MARC field in Elasticsearch mappings table

In Elasticsearch mappings table, in tabs with MARC fields, searching using DataTable search field does not work for MARC fields / subfields.
This is because cell contains an input HTML tag with MARC data in attribute value.

Test plan :
1) Go to Administration > Search engine configuration (Elasticsearch)
2) Go to tab 'Bibliographic records'
3) Enter in search field a used MARC field (like 245)
=> Table gets filtered by rows with mapping on searched field
4) Enter in search field the field+subfield used for issues (952l in KTD)
=> Table gets filtered by rows with mapping on field+subfield
Comment 3 Martin Renvoize 2022-10-20 08:21:32 UTC
Created attachment 142230 [details] [review]
Bug 31887: Fix search on MARC field in Elasticsearch mappings table

In Elasticsearch mappings table, in tabs with MARC fields, searching using DataTable search field does not work for MARC fields / subfields.
This is because cell contains an input HTML tag with MARC data in attribute value.

Test plan :
1) Go to Administration > Search engine configuration (Elasticsearch)
2) Go to tab 'Bibliographic records'
3) Enter in search field a used MARC field (like 245)
=> Table gets filtered by rows with mapping on searched field
4) Enter in search field the field+subfield used for issues (952l in KTD)
=> Table gets filtered by rows with mapping on field+subfield

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Katrin Fischer 2022-11-02 19:28:35 UTC
Created attachment 143032 [details] [review]
Bug 31887: Fix search on MARC field in Elasticsearch mappings table

In Elasticsearch mappings table, in tabs with MARC fields, searching using DataTable search field does not work for MARC fields / subfields.
This is because cell contains an input HTML tag with MARC data in attribute value.

Test plan :
1) Go to Administration > Search engine configuration (Elasticsearch)
2) Go to tab 'Bibliographic records'
3) Enter in search field a used MARC field (like 245)
=> Table gets filtered by rows with mapping on searched field
4) Enter in search field the field+subfield used for issues (952l in KTD)
=> Table gets filtered by rows with mapping on field+subfield

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2022-11-02 19:40:06 UTC
Great little fix!
Comment 6 Fridolin Somers 2022-11-03 21:52:54 UTC
I'm a fan of JS DataTable ;)
Comment 7 Tomás Cohen Arazi 2022-11-04 23:21:29 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!