Sha256: 374082901310524a310c98fe39253d81266a682e937fd724fceacc4453d16ec0

Contents?: true

Size: 704 Bytes

Versions: 70

Compression:

Stored size: 704 Bytes

Contents

module ThinkingSphinx
  module Deltas
    class FlagAsDeletedJob
      attr_accessor :index, :document_id
      
      def initialize(index, document_id)
        @index, @document_id = index, document_id
      end
      
      def perform
        return true unless ThinkingSphinx.updates_enabled?
        
        config = ThinkingSphinx::Configuration.instance
        client = Riddle::Client.new config.address, config.port
        
        client.update(
          @index,
          ['sphinx_deleted'],
          {@document_id => [1]}
        ) if ThinkingSphinx.sphinx_running? &&
          ThinkingSphinx::Search.search_for_id(@document_id, @index)
        
        true
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 15 rubygems

Version Path
DrMark-thinking-sphinx-1.1.14 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
DrMark-thinking-sphinx-1.1.15 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
DrMark-thinking-sphinx-1.1.6 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
DrMark-thinking-sphinx-1.2.5 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
DrMark-thinking-sphinx-1.2.6 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
bterlson-thinking-sphinx-1.2.8 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
dpickett-thinking-sphinx-1.1.12 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
dpickett-thinking-sphinx-1.1.23 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
dpickett-thinking-sphinx-1.1.4 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
ebeigarts-thinking-sphinx-1.1.21 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
ebeigarts-thinking-sphinx-1.1.22 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
ebeigarts-thinking-sphinx-1.2.10 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
factorylabs-thinking-sphinx-1.2.7 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.0 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.1 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.10 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.11 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.12 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.14 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.15 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb