Skip to content

Commit

Permalink
Making it clear workers managing deltas need to be on the same machin…
Browse files Browse the repository at this point in the history
…e as Sphinx.
  • Loading branch information
pat committed Aug 4, 2012
1 parent 91506c2 commit a351f24
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ts/en/deltas.textile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Turning on delta indexing is done within your model's define_index block:
{% highlight rb %}
define_index do
# ...

set_property :delta => true
end
{% endhighlight %}
Expand All @@ -48,6 +48,8 @@ It's also worth noting that when each change happens, and the delta indexing is
ThinkingSphinx.suppress_delta_output = true
{% endhighlight %}

*Please note*: Sphinx requires local disk access to your index files to manage delta indices. This means that if you do shift delta processing to some sort of queue (such as Delayed Job, discussed below, or Resque), the queue workers will need to run on the same machine as Sphinx.

h3. Deltas and Associations

If you are using associations for field or attribute data, delta indexing will not automatically happen when you make changes to those association models. You will need to add a manual delta hook to make it all update accordingly.
Expand Down Expand Up @@ -114,7 +116,7 @@ As for your models, no delta column is required for this method, and enabling it
{% highlight ruby %}
define_index do
# ...

set_property :delta => :datetime, :threshold => 1.hour
end
{% endhighlight %}
Expand All @@ -132,7 +134,7 @@ There is one caveat with this approach: it uses Sphinx's index merging feature,

h4. Delayed Deltas

The more reliable option for smarter delta indexing is using the "Delayed Job":http://github.com/tobi/delayed_job plugin, which queues up the index requests in a separate process (invoked by a constantly running rake task), instead of dealing with them during each web request.
The more reliable option for smarter delta indexing is using the "Delayed Job":http://github.com/tobi/delayed_job plugin, which queues up the index requests in a separate process (invoked by a constantly running rake task), instead of dealing with them during each web request. As mentioned earlier on this page, the process will need local disk access to the Sphinx indices (essentially, your DJ workers need to be run on the same machine as Sphinx).

To get this set up in your web application, you'll need to install the separate gem. It has Delayed Job as a dependency, so that will be automatically installed as well.

Expand Down Expand Up @@ -172,7 +174,7 @@ To enable this approach in your models, change your define_index block to look m
{% highlight ruby %}
define_index do
# ...

set_property :delta => :delayed
end
{% endhighlight %}
Expand Down

0 comments on commit a351f24

Please sign in to comment.