Module: RediSearch::Model::InstanceMethods

Defined in:
lib/redi_search/model.rb

Instance Method Summary collapse

Instance Method Details

#add_to_indexObject



69
70
71
# File 'lib/redi_search/model.rb', line 69

def add_to_index
  self.class.search_index.add(search_document)
end

#remove_from_indexObject



65
66
67
# File 'lib/redi_search/model.rb', line 65

def remove_from_index
  self.class.search_index.del(search_document)
end

#search_document(only: []) ⇒ Object



61
62
63
# File 'lib/redi_search/model.rb', line 61

def search_document(only: [])
  Document.for_object(self.class.search_index, self, only: only)
end