MARC 21 specifies a subfield identifier “may be any any lowercase alphabetic or numeric character” (https://www.loc.gov/marc/96principl.html section 8.4.2). It is not that clear for Unimarc or even for ISO 2709 itself. Our catalogue in Unimarc use uppercase alphabetic subfield identifier for items. When we try to index it with Elasticsearch, it throws an exception (well, it tries to, this is fixed by Bug 23670). We think Elasticsearch shouldn't be picky about uppercase alphabetic subfield identifier, especially when Koha permits their creation in the MARC Framework or in the Elasticsearch mapping.
Created attachment 93133 [details] [review] Bug 23671: Elasticsearch shouldn't throw exception on an uppercase subfield identifier Prevent Elasticsearch from throwing an exception when the mappings include uppercase subfield identifier. Though forbidden in MARC21, It doesn't seem to be the case for Unimarc or ISO 2709 as a whole. It is also possible to define such a subfield identifier in the Koha MARC Framework and in the Elasticsearch mappings. Test plan: 1. add a 995Z subfield identifier in Elasticsearch mappings (Administration -> Search engine configuration) 2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b 3. see it throw: “Invalid MARC field expression: 995Z” 4. apply patch 5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b 6. sababa
Created attachment 93365 [details] [review] Bug 23671: Elasticsearch shouldn't throw exception on an uppercase subfield identifier Prevent Elasticsearch from throwing an exception when the mappings include uppercase subfield identifier. Though forbidden in MARC21, It doesn't seem to be the case for Unimarc or ISO 2709 as a whole. It is also possible to define such a subfield identifier in the Koha MARC Framework and in the Elasticsearch mappings. Test plan: 1. add a 995Z subfield identifier in Elasticsearch mappings (Administration -> Search engine configuration) 2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b 3. see it throw: “Invalid MARC field expression: 995Z” 4. apply patch 5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b 6. sababa Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 93730 [details] [review] Bug 23671: Elasticsearch shouldn't throw exception on an uppercase subfield identifier Prevent Elasticsearch from throwing an exception when the mappings include uppercase subfield identifier. Though forbidden in MARC21, It doesn't seem to be the case for Unimarc or ISO 2709 as a whole. It is also possible to define such a subfield identifier in the Koha MARC Framework and in the Elasticsearch mappings. Test plan: 1. add a 995Z subfield identifier in Elasticsearch mappings (Administration -> Search engine configuration) 2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b 3. see it throw: “Invalid MARC field expression: 995Z” 4. apply patch 5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b 6. sababa Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nice work! Pushed to master for 19.11.00