Class: Chewy::Strategy::Urgent

Inherits:
Base
  • Object
show all
Defined in:
lib/chewy/strategy/urgent.rb

Overview

This strategy updates index on demand. Not the best strategy in case of optimization. If you need to update indexes with bulk API calls - use :atomic instead.

Chewy.strategy(:urgent) do User.all.map(&:save) # Updates index on every save call end

Instance Method Summary collapse

Methods inherited from Base

#leave, #name, #update_chewy_indices

Instance Method Details

#update(type, objects, _options = {}) ⇒ Object



12
13
14
# File 'lib/chewy/strategy/urgent.rb', line 12

def update(type, objects, _options = {})
  type.import!(Array.wrap(objects))
end