为了账号安全,请及时绑定邮箱和手机立即绑定

PUT报错

{
    "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 回答

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"

                     }

        }

    }

}


0 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信