sách gpt4 ai đã đi

elasticsearch - elasticsearch:单个索引中的多种类型

In lại 作者:行者123 更新时间:2023-12-03 16:20:43 28 4
mua khóa gpt4 Nike

我正在尝试在单个索引中创建多个类型。例如,我试图在chủ nhà索引中创建两种类型(bưu kiện,ytb),以便在它们之间创建父子关系。

PUT /ytb
{
"mappings": {
"post": {
"_parent": {
"type": "host"
},
"của cải":{
"@timestamp": {
"type": "date"
},
"indexed": {
"type": "date"
},
"n_comments": {
"type": "long"
},
"n_harvested": {
"type": "long"
},
"n_likes": {
"type": "long"
},
"network": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"parent_id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"post_dbid": {
"type": "long"
},
"post_id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"post_netid": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"published": {
"type": "date"
}
}
},
"host": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"country": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"host_dbid": {
"type": "long"
},
"host_id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"host_netid": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"id": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"indexed": {
"type": "date"
},
"language": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"name": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"vertical": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
}
}
}

但我收到此错误:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [ytb] as the final mapping would have more than 1 type: [post, host]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [ytb] as the final mapping would have more than 1 type: [post, host]"
},
"status": 400
}

làm mới: Elasticsearch版本:6.3.0

1 Câu trả lời

如果您的ES 5.6或更高版本,则需要阅读此内容。综上所述,从ES 6开始,将删除映射类型,并且每个索引仅一种类型将成为标准。

为了在评论中回答您的问题,我知道另一个类似Kibana的工具(实际上是Kibana fork ),它知道如何处理JOIN和关系数据。它被Siren Solutions称为Kibi。另请阅读blog announcement.

关于elasticsearch - elasticsearch:单个索引中的多种类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51056529/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com