ts-delayed-delta (2.0.2) thinking-sphinx (3.1.0) delayed_job (4.0.1) delayed_job_active_record (4.0.1)
On Wednesday, April 23, 2014 11:40:01 PM UTC-7, Pat Allan wrote: > > You’re not missing anything obvious. > > And just to confirm - is it v2.0.2 of thinking-sphinx? or > ts-delayed-delta? If it’s v2.0.2 of thinking-sphinx, I highly recommend > upgrading to v2.1.0 (and v2.0.2 of ts-delayed-delta as well). > > And then if you want to avoid having thinking-sphinx present for the ruby > scripts, you’d need to insert the job manually into the delayed_jobs table > - the handler field needs to have the > ThinkingSphinx::Deltas::DelayedDelta::DeltaJob name and the index name, but > I’m not exactly sure how it’s formatted - possibly JSON or YAML? It’d be > worth firing off some jobs locally in the normal workflow and then see what > the delayed_jobs table contains. > > Cheers > > — > Pat > > On 24 Apr 2014, at 3:26 pm, [email protected] <javascript:> wrote: > > Thanks for the info. We are using ts 2.0.2, have not customized the index > name, and are only adding records. > > The ruby scripts that are adding the records are not running in rails and > don't have the thinking sphinx gem installed. Am I right that I would need > to install the ts gem to access the method you recommended and do some sort > of configuration so that it will know how to connect to the db and add the > jobs? > > I apologize in advance if I'm missing something obvious. > > Thanks, > > On Wednesday, April 23, 2014 6:03:19 PM UTC-7, Pat Allan wrote: >> >> 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.
