Elasticsearch 2.x 版本是不是只能考虑每个 document type 用一个单独的 index 了

2016-03-09 16:57:46 +08:00
 ayang23
v2.x 已经不支持 mapping 内单个字段类型的修改,也不支持 delete mapping
如果 index 内多个 type, scheme migration 基本是不可能的
是不是每个 document type 用一个单独的 index 才是正确的方式

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html

Other than where documented, existing type and field mappings cannot be updated. Changing the mapping would mean invalidating already indexed documents. Instead, you should create a new index with the correct mappings and reindex your data into that index.

https://www.elastic.co/guide/en/elasticsearch/reference/2.2/breaking_20_mapping_changes.html#_types_may_no_longer_be_deleted

In 1.x it was possible to delete a type mapping, along with all of the documents of that type, using the delete mapping API. This is no longer supported, because remnants of the fields in the type could remain in the index, causing corruption later on.

Instead, if you need to delete a type mapping, you should reindex to a new index which does not contain the mapping. If you just need to delete the documents that belong to that type, then use the delete-by-query plugin instead.
4175 次点击
所在节点    Elasticsearch
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/262244

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX