Class: Ladder::Searchable::Background::Indexer

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/ladder/searchable/background.rb

Instance Method Summary collapse

Instance Method Details

#perform(operation, model) ⇒ void

This method returns an undefined value.

Perform a queued index operation

Parameters:

  • operation (String)

    the kind of operation to perform: index, delete, update

  • model (Ladder::Resource, Ladder::File)

    the object instance to modify in the index



42
43
44
45
46
47
48
# File 'lib/ladder/searchable/background.rb', line 42

def perform(operation, model)
  case operation
  when 'index' then model.__elasticsearch__.index_document
  when 'update' then model.__elasticsearch__.update_document
  when 'delete' then model.__elasticsearch__.delete_document
  end
end