Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated geo_shape Parameter (precision) Causes Mapping Errors with Elasticsearch 8 #1649

Open
jairomelo opened this issue Nov 12, 2024 · 1 comment

Comments

@jairomelo
Copy link

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:

$va_element_config[$ps_table.'/'.$vs_element_code] = array(
    'type' => 'geo_shape',
    'precision' => '3m'
);

I modified the code to remove the deprecated precision parameter:

$va_element_config[$ps_table.'/'.$vs_element_code] = array(
    'type' => 'geo_shape'
);

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!

@collectiveaccess
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants