Sha256: 1c6cc4d06e25a10d3ec128320f0634b217a6ed3cd6eeeb6e1fe85e8e983c8926

Contents?: true

Size: 632 Bytes

Versions: 17

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::Deltas::DeleteJob
  def initialize(index_name, document_id)
    @index_name, @document_id = index_name, document_id
  end

  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

  def statement
    @statement ||= Riddle::Query.update(
      @index_name, @document_id, :sphinx_deleted => true
    )
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/deltas/delete_job.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/deltas/delete_job.rb