gpt4 book ai didi

elasticsearch - Elasticsearch Root映射不支持的参数

转载 作者:行者123 更新时间:2023-12-03 02:35:38 25 4
gpt4 key购买 nike

我正在尝试使用以下PUT命令在 Elasticsearch 中配置索引,并收到以下错误。我无法弄清楚是什么错误。我正在使用7.4.2版本的ELK

PUT代码如下:

PUT /myfeed
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
"folding": {
"type": "custom",
"tokenizer": "standard",
"char_filter": ["html_strip"],
"filter": ["lowercase", "asciifolding"]
}
}
}
},
"mappings": {
"feed": {
"_all": {
"enabled": false
},
"properties": {
"feed": {
"type": "keyword"
},
"link": {
"type": "keyword"
},
"published": {
"type": "date"
},
"message": {
"type": "string",
"analyzer": "folding"
},
"title": {
"type": "string",
"analyzer": "folding"
}
}
}
}
}

控制台上的错误如下:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [feed : {_all={enabled=false}, properties={feed={type=keyword}, link={type=keyword}, published={type=date}, message={analyzer=folding, type=string}, title={analyzer=folding, type=string}}}]"
}
},
"status": 400
}

请帮我解决这个问题

最佳答案

_all已被Lupanoide告知弃用(谢谢)
所以对我有用的映射如下

 PUT /myfeed
{
"mappings": {
"properties": {
"feed": {
"type": "keyword"
},
"link": {
"type": "keyword"
},
"published": {
"type": "date"
},
"message": {
"type": "text",
"analyzer": "folding"
},
"title": {
"type": "keyword"
}
}
},
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
"folding": {
"type": "custom",
"tokenizer": "standard",
"char_filter": ["html_strip"],
"filter": ["lowercase", "asciifolding"]
}
}
}
}
}

谢谢

关于elasticsearch - Elasticsearch Root映射不支持的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58954738/

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