Class: ThinkingSphinx::Deltas::FlagAsDeletedJob
- Inherits:
-
Object
- Object
- ThinkingSphinx::Deltas::FlagAsDeletedJob
- Defined in:
- lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
Instance Attribute Summary collapse
-
#document_id ⇒ Object
Returns the value of attribute document_id.
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(index, document_id) ⇒ FlagAsDeletedJob
constructor
A new instance of FlagAsDeletedJob.
- #perform ⇒ Object
Constructor Details
#initialize(index, document_id) ⇒ FlagAsDeletedJob
Returns a new instance of FlagAsDeletedJob.
6 7 8 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb', line 6 def initialize(index, document_id) @index, @document_id = index, document_id end |
Instance Attribute Details
#document_id ⇒ Object
Returns the value of attribute document_id.
4 5 6 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb', line 4 def document_id @document_id end |
#index ⇒ Object
Returns the value of attribute index.
4 5 6 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb', line 4 def index @index end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb', line 10 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 |