module ThinkingSphinx::Deltas
Public Class Methods
config()
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 4 def self.config ThinkingSphinx::Configuration.instance end
processor_for(delta)
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 8 def self.processor_for(delta) case delta when TrueClass ThinkingSphinx::Deltas::DefaultDelta when Class delta when String delta.constantize else nil end end
resume!()
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 21 def self.resume! @suspended = false end
suspend(reference) { || ... }
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 25 def self.suspend(reference, &block) suspend! yield resume! config.indices_for_references(reference).each do |index| index.delta_processor.index index if index.delta? end end
suspend!()
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 44 def self.suspend! @suspended = true end
suspend_and_update(reference, &block)
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 35 def self.suspend_and_update(reference, &block) suspend reference, &block ids = reference.to_s.camelize.constantize.where(delta: true).pluck(:id) config.indices_for_references(reference).each do |index| ThinkingSphinx::Deletion.perform index, ids unless index.delta? end end
suspended?()
click to toggle source
# File lib/thinking_sphinx/deltas.rb, line 48 def self.suspended? @suspended end