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

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

 

解决办法:教程上是6.0的,实际使用的是7.0的。

注意:audittype有两个地方都出现了。

错误的:


curl -H "Content-Type: application/json" -XPOST 'http://192.168.31.205:9200/auditindex/audittype/_mapping?pretty' -d '
{
"audittype":{
        "properties":{
                "jurisdiction":{"type":"keyword"},
                "total":{"type":"integer"},
                "time":{"type":"date","format": "yyyy-MM-dd HH:mm:ss"}
                }
    }
}

 

正确的:


curl -H "Content-Type: application/json" -XPOST 'http://192.168.1.5:9200/auditindex/_mapping?pretty' -d '
{
        "properties":{
                "jurisdiction":{"type":"keyword"},
                "total":{"type":"integer"},
                "time":{"type":"date","format": "yyyy-MM-dd HH:mm:ss"}
                }
}

 

你可能感兴趣的:(es)