If you want to directly add a Delayed Job task to index delta records, the 
following should do the job:

  ThinkingSphinx::Deltas::DelayedDelta.enqueue_unless_duplicates(
    ThinkingSphinx::Deltas::DelayedDelta::DeltaJob.new('article_delta')
  )

Please note that the string is the name of the delta index - which, unless 
you've customised your index names, is the name of your model, underscored, 
with a _delta suffix.

If you're using TS v1/v2 with ts-delayed-delta v2, the string argument is an 
array of strings - so, ['article_delta'] instead of 'article_delta'. If you're 
using an older version of ts-delayed-delta, please upgrade :) (2.0.2 is the 
latest).

Also, it's worth noting that this is best suited for a bunch of new records. If 
you're updating records instead, then both their old and new values will match, 
which is not ideal. There are ways around this, but it's not quite as elegant - 
let me know if you want that detail.

Cheers

-- 
Pat

On 24 Apr 2014, at 7:58 am, [email protected] wrote:

> Is there a way to directly trigger a delta index? We have a rails application 
> with thinking sphinx, delayed_jobs, thinking sphinx delayed deltas, etc... 
> set up. Everything seems to be working fine. Since we regularly add data to 
> the db directly we need a way to trigger the delta index to be built.
> 
> So far, 2 paths to this goal come to mind.
> 1.) Add a row to the delayed_job table that mimics the one ts would create if 
> we used the rails app to add the data.
> 2.) Directly trigger the delta index with a special rake command like 
> ts:index:delta 
> 
> I would appreciate some guidance on which of these two strategies would cause 
> the least issues with thinking sphinx and perhaps a nudge in the direction of 
> some documentation where I could educate myself on how to implement the best 
> choice. (An example of what the values in the job row look like or the rake 
> command)
> 
> Of course, I am open to a better alternative to achieving this goal.
> Thanks, 
> 
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to