]> git.koha-community.org Git - koha.git/commit
Bug 38416: Failover to MARCXML if cannot roundtrip USMARC during indexing
authorDavid Cook <dcook@prosentient.com.au>
Mon, 11 Nov 2024 04:30:06 +0000 (04:30 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 5 Dec 2024 23:07:52 +0000 (23:07 +0000)
commit714775e370759898683278f7f36b5c5546926f0a
tree37f1d2b73dd8961d1cf78481bf091ad786af2b56
parent20c59c0171738f162f4ff68a3febdc46596342c1
Bug 38416: Failover to MARCXML if cannot roundtrip USMARC during indexing

This change failsover to MARCXML from USMARC if there are any
warnings generated by MARC::File::USMARC::decode when trying to
roundtrip the record.

Test plan:
0. Apply the patch
1. Setup your koha-testing-docker to use Elasticsearch
2. Create a new record with 15,000 characters in the 500$a field
3. Index that record
(e.g. perl misc/search_tools/rebuild_elasticsearch.pl --biblios -v -v)
4. Note that a warning saying the following appears:
"Warnings encountered while roundtripping a MARC record to/from USMARC.
Failing over to MARCXML"
5. View the "Elasticsearch record" on the detail page and note that the
marc_format is MARCXML
6. Perform a search for the record (the keyword should be something that
brings up other results too)
7. Note that the record appears correctly in the search results

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0d862343ddce4a86a4932b80d747b9574c739e4d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch.pm