gpt4 book ai didi

elasticsearch - 拒绝对 [] 的映射更新,因为最终映射将有 1 种以上的类型

转载 作者:行者123 更新时间:2023-12-02 22:12:12 24 4
gpt4 key购买 nike

我已经使用显式映射创建索引:

PUT http://192.168.1.71:9200/items
{
"mappings": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"num": {
"type": "long"
}
}
}
}

并尝试添加文档:
POST http://192.168.1.71:9200/items/1
{
"num" : 1.898,
"name" : "aaa"
}

但得到错误:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [items] as the final mapping would have more than 1 type: [_doc, 1]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [items] as the final mapping would have more than 1 type: [_doc, 1]"
},
"status": 400
}

为什么以及如何安装它?

最佳答案

您需要在 id 之前指定文档类型这是 _doc

POST http://192.168.1.71:9200/items/_doc/1
{
"num" : 1.898,
"name" : "aaa"
}

关于elasticsearch - 拒绝对 [] 的映射更新,因为最终映射将有 1 种以上的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57961374/

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