elasticsearch - 什么时候在Elasticsearch中使用 “_type”?

标签 elasticsearch

我开始阅读有关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/

相关文章:

elasticsearch - 如何在 Elasticsearch 中聚合每年基于特定日期的字段?

elasticsearch - 从Oracle导入数据(初始加载)到Elastic Search的最佳方法

elasticsearch - Packetbeat引发散装项目插入失败错误

java - 如何对具有异常条件的多个字段进行排序

elasticsearch - 安装后 Elasticsearch 服务无法启动

java - 根据在 Elasticsearch 中使用的给定CIDR范围从IP地址文件中查询以获取记录集

ruby-on-rails - 如何清除Rails应用程序中的搜索结果?

python - 使用Elasticsearch Python API时如何返回所有分片?

elasticsearch - 仅获取按某个字段汇总/分组的最新Elasticsearch文档的总和

elasticsearch - Elasticsearch:为什么我的索引查询返回的结果不在我的特定索引中