gpt4 book ai didi

amazon-web-services - 如何在kibana的索引中正确嵌套映射?

转载 作者:行者123 更新时间:2023-12-03 01:15:40 25 4
gpt4 key购买 nike

我正在尝试创建一个具有嵌套映射的索引,但是我不确定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
}

最佳答案

在新版本的Elasticsearch中描述了_doc类型
这应该工作
样本1

PUT testindex?pretty=true 
{
"mappings": {
"properties": {
"time": {
"type": "date",
"format": "HH:mm:ss"
}
}
}
}
样本2
PUT testindex1?pretty=true 
{
"mappings": {
"properties": {
"time": {
"type": "date",
"format": "HH:mm:ss"
},
"predicted": {
"type": "nested",
"properties": {
"numofreq": {
"type": "integer"
}
}
}
}
}
}

关于amazon-web-services - 如何在kibana的索引中正确嵌套映射?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62662489/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com