Rails何もわからない民。RDBのデータ件数が猛烈に多く、Elasticsearchへの全件登録にXX時間かかるので、どうにかしようとしている。以下は妄想メモ。そのうち検証する。 現状から書き換えてみる これがテーブル全件登録。現状これでXX時間かかっている。 __elasticsearch__ は elasticsearch-rails というgemがモデルクラスに生やしてるオブジェクト。ここに import とか index_document などのメソッドが生えている。 import の実装は https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-model/lib/elasticsearch/model/importing.rb#L140-L185 Hoge.__elasticsearch