PUT报错

来源:4-1 索引创建

慕盖茨5445909

2019-04-18 19:32

{
    "error": {
        "root_cause": [
            {
                "type": "mapper_parsing_exception",
                "reason": "Root mapping definition has unsupported parameters:  [man : {properties={date={format=yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis, type=date}, country={type=keyword}, name={type=text}, age={type=integer}}}]"
            }
        ],
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [man : {properties={date={format=yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis, type=date}, country={type=keyword}, name={type=text}, age={type=integer}}}]",
        "caused_by": {
            "type": "mapper_parsing_exception",
            "reason": "Root mapping definition has unsupported parameters:  [man : {properties={date={format=yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis, type=date}, country={type=keyword}, name={type=text}, age={type=integer}}}]"
        }
    },
    "status": 400
}

写回答 关注

3回答

  • 慕移动6094604
    2019-12-30 16:05:13

    elasticsearch7默认不在支持指定索引类型,默认索引类型是_doc,如果想改变,则配置include_type_name: true 即可(这个没有测试,官方文档说的,无论是否可行,建议不要这么做,因为elasticsearch8后就不在提供该字段)。

    {

           "settings": {

                  "number_of_shards": 3,

                  "number_of_replicas": 1

           },

           "mappings" : {

            "properties" : {

                "name": {

                                "type": "text"

                         },

                         "country": {

                                "type": "keyword"

                         },

                         "age": {

                                "type": "integer"

                         },

                         "date": {

                                "type": "date",

                                "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"

                         }

            }

        }

    }


  • 小白Cyk
    2019-10-08 13:53:18

    这个问题解决了没?如果解决了,怎么解决的?

  • zhou__
    2019-04-28 15:31:57

    我也这个错,一脸懵逼...

ElasticSearch入门

ElasticSearch轻松入门,Spring Boot集成ES

67740 学习 · 302 问题

查看课程

相似问题