【问题标题】:Tire + Elastic Search - Forcing Import轮胎 + 弹性搜索 - 强制导入
【发布时间】:2013-02-14 05:16:23
【问题描述】:

在轮胎 gem 的 README 中,我看到他们提出了两种导入模型的方法:

rake environment tire:import CLASS='Article'
rake environment tire:import CLASS='Article' FORCE=true

我可以理解 FORCE=true 会在重新索引之前删除索引,但这样做有什么好处?

【问题讨论】:

    标签: ruby-on-rails indexing elasticsearch tire


    【解决方案1】:

    从头开始删除和重新创建索引主要在开发期间更改模型映射时很有用。

    【讨论】:

    • 那么如果你不设置 FORCE=1 并且你改变了映射,那么如果你重新导入模型会发生什么?
    • 未应用新映射。您必须使用 Mymodel.index.mapping({... new mapping...}) 手动更新它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多