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
freelancing-god-thinking-sphinx-1.1.16 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.17 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.18 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.19 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.2 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.20 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.21 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.22 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.23 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.24 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.3 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.4 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.5 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.6 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.7 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.8 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.1.9 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.2.0 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.2.1 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
freelancing-god-thinking-sphinx-1.2.10 lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb