今天在使用Kibana的时候发现,创建映射竟然报错了,报错信息如下:
Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
可能是版本的问题
原代码如下:
PUT niu/_mapping/goods
{
"properties": {
"title": {
"type": "text",
"analyzer": "ik_max_word"
},
"images": {
"type": "keyword",
"index": "false"
},
"price": {
"type": "float"
}
}
}
修改为:
PUT niu/_mapping/goods?include_type_name=true
{
"properties": {
"title": {
"type": "text",
"analyzer": "ik_max_word"
},
"images": {
"type": "keyword",
"index": "false"
},
"price": {
"type": "float"
}
}
}
也就是根据提示在其类型名后面添加:
?include_type_name=true
然后再执行,就会发现执行成功啦~
(红色的是警告