elastic / elasticsearch-rails

Elasticsearch integrations for ActiveModel/Record and Ruby on Rails
Apache License 2.0
3.07k stars 793 forks source link

How to import into two clusters #1054

Open jesseduffield opened 1 year ago

jesseduffield commented 1 year ago

I'm upgrading from cluster version 2.4 to 7.17 and rather than do the upgrade in-place, I'm standing up two clusters and writing to both with the plan of eventually removing the old cluster.

I'm using the repository pattern to do this which is working well for creating individual documents in ES, however I'm not sure how to achieve the same behaviour when it comes to importing ActiveRecord objects in bulk.

Currently I'm going 'MyModel.import(...)' but I want a way of either:

I'm using version 7.2.1 of the gem.

How could I go about this? Thanks.