Sha256: a6e8ceeb76b0ea43cb2f657197a10c28252b24120a0794140e4c7633f13c19cd

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

module WorklingDelta
  # This is the class that that should be wired to your index configuration
  # @example definition in an index
  #   define_index do |index|
  #     set_property :delta => WorklingDelta::Indexer
  #   end
  class Indexer < ThinkingSphinx::Deltas::DefaultDelta
    # Creates the worker that performs the delta indexing
    # @param model the class of that triggered the delta
    # @param instance the instance that changed (if applicable)
    # @return [Boolean] should always return true
    def do_index(model, instance = nil)
      doc_id = instance ? instance.sphinx_document_id : nil
      WorklingDelta::Worker.async_index(:index_name => delta_index_name(model), :document_id => doc_id)
    
      true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workling_delta_indexer-0.1.2 lib/workling_delta/indexer.rb