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

水深无声 2023-01-05 12:24 178阅读 0赞

完整报错信息

(Python3.6) appleyuchi@Desktop:~/桌面/Flink_Code/flink清洗数据案例/FlinkProj$ ./kibana.sh
{“acknowledged”:true}{“acknowledged”:true,”shards_acknowledged”:true,”index”:”auditindex”}{
“error” : {
“root_cause” : [
{
“type” : “illegal_argument_exception”,
“reason” : “Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true.”
}
],
“type” : “illegal_argument_exception”,
“reason” : “Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true.”
},
“status” : 400
}

解决方案:

  1. url -H "Content-Type: application/json" -XPOST 'http://master:9200/auditindex/audittype/_mapping?pretty' -d '
  2. {
  3. "audittype":{
  4. "properties":{
  5. "area":{"type":"keyword"},
  6. "type":{"type":"keyword"},
  7. "count":{"type":"long"},
  8. "time":{"type":"date","format": "yyyy-MM-dd HH:mm:ss"}
  9. }
  10. }
  11. }
  12. '

改成

  1. curl -H "Content-Type: application/json" -XPOST 'http://Desktop:9201/auditindex/audittype/_mapping?include_type_name=true' -d '
  2. {
  3. "audittype":{
  4. "properties":{
  5. "area":{"type":"keyword"},
  6. "type":{"type":"keyword"},
  7. "count":{"type":"long"},
  8. "time":{"type":"date","format": "yyyy-MM-dd HH:mm:ss"}
  9. }
  10. }
  11. }
  12. '

最终正确的信息如下:

(Python3.6) appleyuchi@Desktop:~/桌面/Flink_Code/flink清洗数据案例/FlinkProj$ ./kibana.sh
{“acknowledged”:true}{
“acknowledged” : true,
“shards_acknowledged” : true,
“index” : “auditindex”
}

Reference:

[1]elasticsearch7.x遇到的bug汇总

发表评论

表情:
评论列表 (有 0 条评论,178人围观)

还没有评论,来说两句吧...

相关阅读