Browse files

Making it clear workers managing deltas need to be on the same machin…

…e as Sphinx.
  • Loading branch information...
1 parent 91506c2 commit a351f24293903c350c5d8dc70efe3d21817d15b9 @pat pat committed Aug 4, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 ts/en/deltas.textile
10 ts/en/deltas.textile
@@ -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 %}
@@ -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.
@@ -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 %}
@@ -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.
@@ -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 %}

0 comments on commit a351f24

Please sign in to comment.