I've recently encountered an issue while configuring Elasticsearch 8 with CollectiveAccess Providence (v1.8). During the search index rebuild process, the following error was raised:
PHP Fatal error: Uncaught Exception: Updating the ElasticSearch mapping failed. This is probably because of a type conflict. Try recreating the entire search index. The original error was {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping: using deprecated parameters [precision] in mapper [ca_objects/georeference] of type [geo_shape] is no longer allowed"}},"status":400}
The geo_shape field in the ElasticSearch.php plugin uses the precision parameter, which has been deprecated and is no longer supported in Elasticsearch 8. This causes the index creation to fail.
Affected Code:
In the app/lib/Plugins/SearchEngine/ElasticSearch/Mapping.php file:
It might be helpful for the development team to update this logic for compatibility with Elasticsearch 8. Perhaps conditional checks could be introduced for different Elasticsearch versions, or simply dropping the deprecated parameter as it is now internally handled by Elasticsearch.
We have not revised the ElasticSearch code for compatibility with recent versions. Thank you for these changes. We will look to integrate them in the coming months.
I've recently encountered an issue while configuring Elasticsearch 8 with CollectiveAccess Providence (v1.8). During the search index rebuild process, the following error was raised:
PHP Fatal error: Uncaught Exception: Updating the ElasticSearch mapping failed. This is probably because of a type conflict. Try recreating the entire search index. The original error was {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping: using deprecated parameters [precision] in mapper [ca_objects/georeference] of type [geo_shape] is no longer allowed"}},"status":400}
The geo_shape field in the ElasticSearch.php plugin uses the precision parameter, which has been deprecated and is no longer supported in Elasticsearch 8. This causes the index creation to fail.
Affected Code: In the
app/lib/Plugins/SearchEngine/ElasticSearch/Mapping.php
file:I modified the code to remove the deprecated precision parameter:
It might be helpful for the development team to update this logic for compatibility with Elasticsearch 8. Perhaps conditional checks could be introduced for different Elasticsearch versions, or simply dropping the deprecated parameter as it is now internally handled by Elasticsearch.
Thanks for your great work!