Class: ThinkingSphinx::Deltas::DeltaJob
- Inherits:
-
Object
- Object
- ThinkingSphinx::Deltas::DeltaJob
- Defined in:
- lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb
Overview
A simple job class that processes a given index.
Instance Attribute Summary collapse
-
#indexes ⇒ Object
Returns the value of attribute indexes.
Instance Method Summary collapse
-
#initialize(indexes) ⇒ DeltaJob
constructor
Initialises the object with an index name.
-
#perform ⇒ Boolean
Runs Sphinx’s indexer tool to process the index.
Constructor Details
#initialize(indexes) ⇒ DeltaJob
Initialises the object with an index name.
10 11 12 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb', line 10 def initialize(indexes) @indexes = indexes end |
Instance Attribute Details
#indexes ⇒ Object
Returns the value of attribute indexes.
4 5 6 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb', line 4 def indexes @indexes end |
Instance Method Details
#perform ⇒ Boolean
Runs Sphinx’s indexer tool to process the index. Currently assumes Sphinx is running.
19 20 21 22 23 24 25 26 |
# File 'lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb', line 19 def perform config = ThinkingSphinx::Configuration.instance output = `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file} --rotate #{indexes.join(' ')}` puts output unless ThinkingSphinx.suppress_delta_output? true end |