我正在尝试创建一个具有嵌套映射的索引,但我不确定 json 数据应该是什么样子。我正在使用 kibana 版本 v 7.4.2。下面的示例有效,但是如果当我尝试添加任何嵌套映射(示例 2)时,最后会出现错误。
样品 1
PUT testIndex?pretty=true
{
"mappings":{
"_doc":{
"properties":{
"time":{
"type":"date",
"format":"HH:mm:ss"
}
}
}
}
}
样品 2
PUT testIndex?pretty=true
{
"mappings":{
"_doc":{
"properties":{
"time":{
"type":"date",
"format":"HH:mm:ss"
}
},
"predicted":{
"type":"nested",
"properties":{
"numofreq":{
"type":"integer"
}
}
}
}
}
}
错误
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true."
}
],
"type": "illegal_argument_exception",
"reason": "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true."
},
"status": 400
}