Jireh程序猿的那些事 Jireh程序猿的那些事

记录分享生活、程序、信息的精彩人生

目录
Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true
/  

Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true

ElasticSearch创建索引报错 Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true

原因是elasticsearch7.x版本不支持type(低版本写法)所致,所以在高版本使用type,需要传入include_type_name参数,值为true。

POST 192.168.5.101:9200/trouble_request_log/_doc/_mappings?include_type_name=true
{
    "_doc":{
        "properties":{
            "path":{
                "type":"text"
            },
            "query_string":{
                "type":"text"
            },
            "uid":{
                "type":"long"
            },
            "add_time":{
                "type":"date",
                "format":"yyyy-MM-dd HH:mm:ss || yyyy-MM-dd || epoch_millis"
            }
        }
    }
}

如果觉得这篇文章不错的话,请我喝一杯 咖啡☕吧
标题:Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true
作者:Jireh
地址:https://jireh.xyz/articles/2021/04/06/1617689815461.html
本作品由 Jireh 采用 署名 – 非商业性使用 – 禁止演绎 4.0 国际许可协议进行许可,转载请注明出处。