Search code examples
ruby-on-railsthinking-sphinxdelta-index

How can I temporarily disable delta indexing with Thinking Sphinx?


I am running a big migration and would like to disable delta indexing so it runs much faster.

Is there a way to specify in the beginning of the task to turn delta indexing off?


Solution

  • Two options:

    Model.suspended_delta do
      # all actions in the block don't fire a delta request
    end
    # A single delta request gets fired at the end
    

    Or, what may be better in your situation:

    ThinkingSphinx.deltas_enabled = false
    

    And set it back to true when you're done.