Class: WorklingDelta::Worker

Inherits:
Workling::Base
  • Object
show all
Defined in:
lib/workling_delta/worker.rb

Overview

The Worker that actually performs the delta indexing This class performs the indexing asyncronously for Workling configurations

Instance Method Summary (collapse)

Instance Method Details

- (Object) index(options = {})

perform the index

Options Hash (options):

  • :index_name (String)

    the name of the index to run the delta job on

  • :document_id (Integer, nil)

    the sphinx document id of the object that needs to be flagged as deleted



7
8
9
10
11
12
13
14
# File 'lib/workling_delta/worker.rb', line 7

def index(options = {})
  ThinkingSphinx::Deltas::DeltaJob.new(options[:index_name]).perform
  
  if options[:document_id]
    ThinkingSphinx::Deltas::FlagAsDeletedJob.new(options[:index_name], 
      options[:document_id]).perform
  end
end