Sha256: 1531df184b9a4b01371cdf0e3433945d6f3f8a7bde4e146a8584fafc5762d58e

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 KB

Contents

h1. Delayed Deltas for Thinking Sphinx

h2. Installation

You'll need Thinking Sphinx 1.3.0 or later, and Delayed Job as well. The latter is flagged as a dependency.

<pre><code>gem install ts-delayed-delta --source http://gemcutter.org</code></pre>

In your @environment.rb@ file, with the rest of your gem dependencies:

<pre><code>config.gem 'ts-delayed-delta',
  :lib     => 'thinking_sphinx/deltas/delayed_delta'
  :version => '>= 1.0.0',
  :source  => 'http://gemcutter.org'</code></pre>

And add the following line to the bottom of your @Rakefile@:

<pre><code>require 'thinking_sphinx/deltas/delayed_delta/tasks'</code></pre>

If this is your first time running Delayed Job, then you're going to need the jobs table migration as well:

<pre><code>script/generate delayed_job</code></pre>

For the indexes you want to use this delta approach, make sure you set that up in their @define_index@ blocks.

<pre><code>define_index do
  # ...
  
  set_property :delta => :delayed
end</code></pre>

If you've never used delta indexes before, you'll want to add the boolean column named delta to each model that is using the approach.

<pre><code>def self.up
  add_column :articles, :delta, :boolean, :default => true, :null => false
end</code></pre>

h2. Usage

Once you've got it all set up, all you need to do is make sure that the delayed job process is running - either by Delayed Job's built-in approach, or Thinking Sphinx's custom rake task:

<pre><code>rake thinking_sphinx:delayed_delta</code></pre>

There's also a short name for the same task, to save your fingers some effort:

<pre><code>rake ts:dd</code></pre>

h2. Copyright

Copyright (c) 2009 Pat Allan, and released under an MIT Licence.

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
warp-ts-delayed-delta-1.0.3 README.textile
warp-ts-delayed-delta-1.0.2 README.textile
ts-delayed-delta-1.0.2 README.textile
ts-delayed-delta-1.0.1 README.textile
ts-delayed-delta-1.0.0 README.textile