【发布时间】:2016-03-09 15:28:40
【问题描述】:
看这个答案,Update ElasticSearch mapping in production (Tire),导入新索引名称的主要方法是使用 rake
我正在使用 mysqlriver 导入我的数据(有很多,我喜欢控件)。当我第一次使用轮胎设置加载我的 ruby 模型时,它会自动创建一个索引。如何更改它使用的索引名称?
class Tag
include Tire::Model::Search
mapping do
indexes :id, :index => :not_analyzed
indexes :name, :analyzer => 'snowball'
end
after_destroy { self.index.remove(self) rescue nil }
after_save { reindex_dirty %w(name deleted) }
end
我的目标是让它创建一个名为“tag_version_1”的索引,这样我就可以创建一个别名并进行零停机索引更改。
【问题讨论】:
标签: ruby-on-rails elasticsearch tire