unknown parameter [analyzer] on mapper [address] of type [keyword]
时间: 2023-10-01 07:09:12 浏览: 58
这个错误通常是由于在使用Elasticsearch时指定了不支持的参数或使用了错误的参数类型。在这个错误消息中,问题出现在名为"address"的关键字字段的分析器参数上。关键字字段不支持分析器参数,因为它们不需要分析。你需要检查你的代码并确保你没有尝试在关键字字段上指定分析器参数。如果需要分析,请使用文本字段类型。
相关问题
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
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.
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=illegal_argument_exception, reason=Unknown analyzer type [ik] for [default]]
这个错误提示表明 Elasticsearch 不识别使用的分词器类型 "ik"。这可能是由于以下原因:
1. 未正确安装 IK 分词器插件:请确保已将 IK 分词器插件正确安装到 Elasticsearch 集群中。您可以参考 IK 分词器的官方文档或使用适用于您 Elasticsearch 版本的插件安装方法进行安装。
2. 分词器名称不正确:在设置分词器时,确保指定的分词器名称与实际安装的分词器名称匹配。不同版本的 IK 分词器可能会使用不同的名称,您可以查看您所使用的 IK 分词器的官方文档或示例代码以获取正确的分词器名称。
3. 插件版本不兼容:如果您使用的是较新的 Elasticsearch 版本,可能存在与 IK 分词器插件版本不兼容的情况。请确保您所使用的 IK 分词器插件版本与 Elasticsearch 版本相匹配。
解决此问题的步骤包括:
- 确保已正确安装 IK 分词器插件,并且版本与 Elasticsearch 相匹配。
- 检查分词器名称是否正确。
- 如果问题仍然存在,请尝试更新 IK 分词器插件或使用其他版本的 Elasticsearch。
希望这些信息对您有所帮助。如果您仍然遇到问题,请提供更多的错误信息和配置细节,以便更好地帮助您。