kitodo-production
kitodo-production copied to clipboard
Fixes mapper parsing exception: normalizer 'lowercase' not found
Fixes #5909
I'm unsure if your suggested change create an issue for other (newer) ElasticSearch versions and how did this effect running Kitodo.Production instances which did not got the changes of the changed json files in their running ElasticSearch servers?
I tested it on my system where the problem did not exist and here the change does not result in an error. You can also test the change, but I don't expect any problems.
Hi Matthias, I quickly checked this as per request of @solth.
As you stated in #5909, the affected ElasticSearch was version 7.3.1, released in August 2019. ElasticSearch added a "pre-configured lowercase normalizer" in April 2020, see https://github.com/elastic/elasticsearch/commit/d83798f237aa27d4695d830bfe732ba82c83aa49. So, the error message is definitely caused by the old ElasticSearch version and the addition of the lowercase
normalizer by me in September 2022 (see https://github.com/kitodo/kitodo-production/commit/c6958bdd8a500612a2fc6df27d4e68904e9672e3).
Anyway, there is an old (not yet completed) ElasticSearch issue https://github.com/elastic/elasticsearch/issues/22263 that aims to disallow defining custom normalizer with the same name as built-in normalizer (meaning the name lowercase
). Because of that, we should consider to use a different name than lowercase
for the custom normalizer.
I do not have access to any old ElasticSearch indexes. Testing this (including @henning-gerhardt worries of potential migration issues) would take quite some time.
Personally, I would prefer to announce a required minimum ElasticSearch version for Kitodo-Production and not merge this workaround. For this particular problem, the minimum version would be at least >= 7.8.0 (released in June 2020).
I developed this change for a customer for a "it doesn't work" situation. For the background, because they have to use SLES distribution, and I never encountered this error anywhere else. I saw that the patch doesn't break anything, but if it's doubtful then we can leave it unmerged. But maybe it should go into the documentation that this can be a problem, and then you can at least merge it locally and suddenly it works. By replacin ElasticSearch in favor of Hibernate Search, it might be that it is no longer a problem anyway.