【发布时间】:2023-03-17 00:04:01
【问题描述】:
我使用的是 elasticsearch 6.6.0,我正在尝试创建和索引它失败并出现非法参数异常:
[root_cause] => Array
(
[0] => stdClass Object
(
[type] => illegal_argument_exception
[reason] => unknown setting [index.mappings.place.properties.address.fields.city.fields.de.analyzer] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
)
)
[type] => illegal_argument_exception
[reason] => unknown setting [index.mappings.place.properties.address.fields.city.fields.de.analyzer] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
[suppressed] => Array
(
[0] => stdClass Object
(
[type] => illegal_argument_exception
[reason] => unknown setting [index.mappings.place.properties.address.fields.city.fields.de.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
)...
此时我不知道我做错了什么。根据documentation,我应该能够使用包含其他属性的字段创建索引。
[编辑] 所以我遇到了多个问题:
- 每个人都指出设置中右花括号的位置错误
- string 不再是一种类型,应由@IanGabes 指出的文本或关键字替换
- text + not_analyzed 必须替换为关键字
- 使用关键字(类型)作为字段名称
- 地址上右花括号的位置错误
非常感谢大家。
【问题讨论】:
-
映射的第一个问题是它
mapping不是settings的子对象,它是兄弟对象。你想要:PUT index {"settings":{...},"mapping":{...}}。在此之后,您在类型中还有一些问题需要解决,但至少您会有一些新的错误消息需要处理。 -
string不是数据类型,请在text和keyword之间选择
标签: elasticsearch