I have an indexed model that has an associated record with fields that
are indexed. One associated record can be associated with many of the
indexed model records. So when the associated record is updated, I
need to go through and set the delta flag on each of my model's
records. I thought that I could use Model.suspended_delta to do the
delta index in one operation at the end, but what happens is that at
the end of the process, a separate index process happens for every
flagged record, saving no time at all. So if I set delta=true on 100
records, the indexer runs 100 times. Is this how it is supposed to
work?

Example:

associated_record.name = "new name"

MyModel.suspended_delta do
  associated_record.my_records.each do |record|
    record.delta = true
    record.save
   # no index occurs here, good.
  end
end
# A separate index process runs for every record with delta == true. I
want one index process to run if possible.


Thanks,
Ben

-- 
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