Class: Chewy::Strategy::AtomicNoRefresh
- Defined in:
- lib/chewy/strategy/atomic_no_refresh.rb
Overview
This strategy works like atomic but import objects with refresh=false
parameter.
Chewy.strategy(:atomic_no_refresh) do User.all.map(&:save) # Does nothing here Post.all.map(&:save) # And here # It imports all the changed users and posts right here # before block leaving with bulk ES API, kinda optimization end
Instance Method Summary collapse
Methods inherited from Atomic
Methods inherited from Base
#name, #update, #update_chewy_indices
Constructor Details
This class inherits a constructor from Chewy::Strategy::Atomic
Instance Method Details
#leave ⇒ Object
13 14 15 |
# File 'lib/chewy/strategy/atomic_no_refresh.rb', line 13 def leave @stash.all? { |type, ids| type.import!(ids, refresh: false) } end |