Module: SimpleSolr::ActiveRecord::InstanceMethods

Defined in:
lib/simple_solr/active_record.rb

Instance Method Summary collapse

Instance Method Details

#add_to_solrObject

callback which uses httparty to send a POST to solr.



35
36
37
38
39
# File 'lib/simple_solr/active_record.rb', line 35

def add_to_solr
  if SimpleSolr.configuration.present?
    self.class.post(SimpleSolr.configuration.master_uri + "/update?commit=true", :body => to_solr)
  end
end

#delete_from_solrObject



41
42
43
44
45
# File 'lib/simple_solr/active_record.rb', line 41

def delete_from_solr
  if SimpleSolr.configuration.present?
    self.class.post(SimpleSolr.configuration.master_uri + "/update?commit=true", :body => to_solr_delete)
  end
end