V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ayang23
V2EX  ›  Elasticsearch

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

  •  
  •   ayang23 · 2016-03-09 16:57:46 +08:00 · 4034 次点击
    这是一个创建于 2963 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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.
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2853 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:28 · PVG 14:28 · LAX 23:28 · JFK 02:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.