尝试创建带有映射的索引时,获取了invalid_argument_exception

时间:2019-02-15 16:06:25

标签: elasticsearch

我正在使用Elasticsearch 6.6.0,并且试图创建它并对其进行索引,但出现了invalid_argument_exception:

[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
                        )...

我的映射:http://myjson.com/1559qq

在这一点上,我不知道我在做什么错。根据{{​​3}},我应该能够使用包含其他属性的字段创建索引。

[编辑] 所以我有多个问题:

  • 每个人指出的设置中大括号的错误放置
  • 字符串不再是类型,应替换为@IanGabes所指向的文本或关键字
  • 文本+ not_analyzed必须用关键字替换
  • 使用关键字(类型)作为字段名称
  • 右花括号在地址上的放置错误

非常感谢大家。

1 个答案:

答案 0 :(得分:1)

您的json是错误的,您的映射位于settings内部,elastic认为您的field mappingsindex mapping settings,正如您在错误消息中看到的那样:

unknown setting [index.mappings.place.properties.address.fields.city.fields.de.type] 

您需要像下面这样关闭settings的大括号。

{
  "settings": {
    "index": {
      "number_of_shards": 1,
      "number_of_replicas": 1
     }
    },
    "mappings": {
      "place": {
        "properties": {
          ...