how to fix Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [_doc]: no handler for type [icu_collation_keyword] declared on field [so
时间: 2024-04-08 08:30:54 浏览: 22
To fix the Elasticsearch exception of type `mapper_parsing_exception` with the reason "Failed to parse mapping [_doc]: no handler for type [icu_collation_keyword] declared on field [so]," you need to make sure that the ICU plugin is installed and enabled in Elasticsearch.
Here are the steps to follow:
1. Check if the ICU plugin is installed by running the following command in your Elasticsearch bin directory:
```
bin/elasticsearch-plugin list
```
If ICU is not listed, you can install it by running the following command:
```
bin/elasticsearch-plugin install analysis-icu
```
2. Once the ICU plugin is installed, you need to enable it by adding the following configuration to your Elasticsearch configuration file (`elasticsearch.yml`):
```
index.analysis.analyzer.default.type: "custom"
index.analysis.analyzer.default.tokenizer: "icu_tokenizer"
```
3. After making the changes, restart Elasticsearch for the changes to take effect.
Once Elasticsearch restarts, the `icu_collation_keyword` type should be recognized, and the exception should be resolved.