class ThinkingSphinx::Deltas::DeleteJob

Public Class Methods

new(index_name, document_id) click to toggle source
# File lib/thinking_sphinx/deltas/delete_job.rb, line 2
def initialize(index_name, document_id)
  @index_name, @document_id = index_name, document_id
end

Public Instance Methods

perform() click to toggle source
# File lib/thinking_sphinx/deltas/delete_job.rb, line 6
def perform
  return if @document_id.nil?

  ThinkingSphinx::Logger.log :query, statement do
    ThinkingSphinx::Connection.take do |connection|
      connection.execute statement
    end
  end
rescue ThinkingSphinx::ConnectionError => error
  # This isn't vital, so don't raise the error.
end

Private Instance Methods

statement() click to toggle source
# File lib/thinking_sphinx/deltas/delete_job.rb, line 20
def statement
  @statement ||= Riddle::Query.update(
    @index_name, @document_id, :sphinx_deleted => true
  )
end