Module: Caoutsearch::Model::Indexable::ClassMethods

Defined in:
lib/caoutsearch/model/indexable.rb

Instance Method Summary collapse

Instance Method Details

#delete_index(id) ⇒ Object



33
34
35
# File 'lib/caoutsearch/model/indexable.rb', line 33

def delete_index(id)
  index_engine_class.delete_document(id)
end

#delete_indexesObject



26
27
28
29
30
31
# File 'lib/caoutsearch/model/indexable.rb', line 26

def delete_indexes
  find_in_batches do |batch|
    ids = batch.map(&:id)
    index_engine_class.delete_documents(ids)
  end
end

#reindex(*properties, **options, &block) ⇒ Object



22
23
24
# File 'lib/caoutsearch/model/indexable.rb', line 22

def reindex(*properties, **options, &block)
  index_engine_class.reindex(all, *properties, **options, &block)
end