class Chewy::Strategy::AtomicNoRefresh

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

Public Instance Methods

leave() click to toggle source
# File lib/chewy/strategy/atomic_no_refresh.rb, line 13
def leave
  @stash.all? { |type, ids| type.import!(ids, refresh: false) }
end