Bug 23671: Elasticsearch shouldn't throw exception on an uppercase subfield identifier
authorNicolas Legrand <nicolas.legrand@bulac.fr>
Mon, 23 Sep 2019 16:55:56 +0000 (18:55 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 7 Oct 2019 12:00:16 +0000 (13:00 +0100)
commit7a80c94d96d5d0717d9a73a4d73fd1b7256bb181
tree2766d63e11997d9495f2a32bf9c005680f160c3f
parent12d33316918d6e333c670d0cc4a218bda2c964c6
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/SearchEngine/Elasticsearch.pm