Thanks for the reply. I tried that and it wasn't working, but then
realized I was quite behind on versions. So I have upgraded to 1.3.15
and the ts-delayed gem 1.0.0. However, now my delayed job no longer
works. I created another thread for that question.

Brian

On Feb 11, 8:52 pm, Pat Allan <[email protected]> wrote:
> Hi Brian
>
> If you're doing all these operations at once, I'd recommend wrapping it in a 
> suspended_delta call:
>
> Model.suspended_delta do
>   # update the thousands of records
> end
>
> This will ensure the delta processing is only done once, at the end.
>
> Also, TS will try to respect the dirty status of AR records in recent 
> versions of AR, but if there are any fields or attributes from associations 
> or manually defined SQL strings, then it can't be certain about what data is 
> used for Sphinx indexes, and so forces the delta flag to true anyway.
>
> The callbacks that relate to all this are:
>   before_save :toggle_delta
>   after_commit :index_delta
>
> Hope this information makes sense.
>
> Cheers
>
> --
> Pat
>
> On 11/02/2010, at 1:13 AM, Brian wrote:
>
> > I have a situation where I update thousands of records from an
> > external source. The majority of records don't really change, and the
> > only way I know which have not change is via the dirty records
> > functionality in Rails. However, it appears to me that the delta
> > indexing does not check to see if the record changes, but triggers
> > always anyway. So I end up with thousands of delta jobs to process,
> > even when very little data changed.
>
> > What callback is being used to trigger a delta? Is there anyway I can
> > suppress this, and have it only run if the object actually changed?
>
> > Brian
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Thinking Sphinx" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/thinking-sphinx?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to