Bug 31887 - Search on MARC field does not work in Elasticsearch mappings table
Summary: Search on MARC field does not work in Elasticsearch mappings table
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-20 08:10 UTC by Fridolin Somers
Modified: 2023-06-08 22:32 UTC (History)
2 users (show)

See Also:
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 (2.54 KB, patch)
2022-10-20 08:19 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 31887: Fix search on MARC field in Elasticsearch mappings table (2.60 KB, patch)
2022-10-20 08:21 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 31887: Fix search on MARC field in Elasticsearch mappings table (2.66 KB, patch)
2022-11-02 19:28 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!