gpt4 book ai didi

elasticsearch - Elasticsearch类型与具有不同架构的索引

转载 作者:行者123 更新时间:2023-12-03 00:41:07 25 4
gpt4 key购买 nike

https://www.elastic.co/blog/index-vs-type

什么是类型?

Fields need to be consistent across types. For instance if two fields have the same name in different types of the same index, they need to be of the same field type (string, date, etc.) and have the same configuration.



还有“我应该使用哪个”

Do your documents have similar mappings? If no, use different indices.



但是,仍然在 https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child.html中提到我们需要将父子文档放置在同一索引中。但是亲子多久有一次相似的映射?


我要调查的是是否应该将2个不同的文档放在相同的索引中,以便可以进行父子搜索。

但是我从索引vs类型中了解到的是,具有不同架构的文档实际上应该放置在不同的索引中,但是亲子关系如何工作?

最佳答案

“相似映射”仅表示具有相同名称但在两种不同映射类型中的字段必须具有相同的数据类型。

拥有不同的父子映射类型是完全可以的,唯一的限制是这两个映射必须不包含名称相同但数据类型不同的字段。

例如,如果父映射具有名为age类型的int的字段,则子映射类型不能具有agelong类型的名为string的字段

关于elasticsearch - Elasticsearch类型与具有不同架构的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40037355/

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