Module: Sunspot::Mongoid::ClassMethods

Defined in:
lib/sunspot/mongoid.rb

Instance Method Summary collapse

Instance Method Details

#solr_index(opt = {}) ⇒ Object

The sunspot solr_index method is very dependent on ActiveRecord, so we’ll change it to work more efficiently with Mongoid.



40
41
42
43
44
45
# File 'lib/sunspot/mongoid.rb', line 40

def solr_index(opt={})
  all.each do |m|
    Sunspot.index(m)
  end
  Sunspot.commit
end