我开始阅读有关Elasticsearch
的文档,并阅读了Elasticsearch documentation中的_type
元数据元素:
Elasticsearch exposes a feature called types which allows you to logically partition data inside of an index. Documents in different types may have different fields, but it is best if they are highly similar.
所以我的问题是:在哪种情况下,最佳实践是将文档分成类型?因为他们在文档中写道,不同
_types
中的文档应具有相似的字段。
最佳答案
关于类型与索引的文章不错:https://www.elastic.co/blog/index-vs-type
具有相同的映射和字段是一个很好的起点(因为稀疏是一个问题)。请注意,将来会删除类型,所以不要过分围绕您的逻辑。但是,您将可以对枚举(如字段)和查询中的过滤器执行相同的操作。
关于elasticsearch - 什么时候在Elasticsearch中使用 “_type”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43789237/