Disable Solr during database recovery

I am working on a rails project that includes solr sunspot stone. I left the default behavior for automatically updating the index when saving the model, but I was wondering if there is a way to temporarily disable indexing when mass creating objects, for example, during the rake db: seed process. When using the seed command, I was hoping it would add all the objects and then make one big call to reindex to update the whole table. Any ideas?

Thank!

+3
source share
2 answers

You can set up a Sunspot session on StubSessionProxy.

+5
source

There is also this .

, sunspot.yml:

development:
    disabled: true

, . , - , - :

Sunspot.config.pagination.default_per_page = 50

, :

undefined method `config' for #<Sunspot::Rails::StubSessionProxy:0x007ff6ee33df28>
+1

All Articles