【发布时间】:2019-05-15 23:43:19
【问题描述】:
在 Elasticsearch 文档的几页中提到了如何查询多类型索引。 但是我一开始就没有创建一个。
这是我的最小示例(在 Elasticsearch 6.x 服务器上):
PUT /myindex
{
"settings" : {
"number_of_shards" : 1
}
}
PUT /myindex/people/123
{
"first name": "John",
"last name": "Doe"
}
PUT /myindex/dog/456
{
"name": "Rex"
}
索引创建和拳头插入做得很好,但是在狗类型插入尝试中:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [myindex] as the final mapping would have more than 1 type: [people, dog]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [myindex] as the final mapping would have more than 1 type: [people, dog]"
},
"status": 400
}
但这正是我想要做的,伙计!我的索引中有“超过 1 种类型”。
您知道我必须在调用中进行哪些更改才能实现这一目标吗?
非常感谢。
【问题讨论】:
-
从 6.0.0 开始不支持多种映射类型。 elastic.co/guide/en/elasticsearch/reference/6.0/…
-
简单明了,谢谢。我建议您将其作为答案,以备将来搜索。
标签: elasticsearch elasticsearch-6