Search code examples
ruby-on-railssolrsunspotsunspot-rails

Disable Solr during database rebuild


I am working on a rails project that involves the solr sunspot gem. I left the default behavior to auto update the index on model saves, but I was wondering if there was a way to temporarily disable the indexing when mass creating objects, such as during a rake db:seed process. When using the seed command I was hoping it would add all of the objects and then perform one big reindex call to update the entire table. Any ideas?

Thanks!


Solution

  • You could set Sunspot's session to a StubSessionProxy.