Class: WorklingDelta::Indexer

Inherits:
ThinkingSphinx::Deltas::DefaultDelta
  • Object
show all
Defined in:
lib/workling_delta/indexer.rb

Overview

This is the class that that should be wired to your index configuration

Examples:

definition in an index

define_index do |index|
  set_property :delta => WorklingDelta::Indexer
end

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) do_index(model, instance = nil)

Creates the worker that performs the delta indexing



12
13
14
15
16
17
# File 'lib/workling_delta/indexer.rb', line 12

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