I was wondering whether there is an easy way to check that a TS delayed 
delta job has finished? I have a scenario in which I need to run a new 
search in an after_save callback and of course I'd like to see the changes 
to the delta index reflected in the search results.

Here are some details of my example:

I have a model called Feature which has many annotations (Annotation 
model). The index looks like this:

define_index do

   indexes annotations.value, :as => :annotations

  # other indexes

  has annotations.status(:name), :as => :annotation_status 

  where "statuses.name = 'current' AND (statuses_annotations.name = 
'current' OR statuses_annotations.name IS NULL)"

  set_property :delta => :delayed

end

An annotation can change it's value or it can become outdated (status 
change), in which case I update the delta attribute of the associated 
feature in an Annotation model callback. Setting the delta attribute to 
true spins off a delayed_job task to update the delta index. In a separate 
callback I'd like to perform a new search against the updated delta index, 
but I noticed that the search never reflects the current state of the 
index. This is no doubt because the delta jobs are not finished yet. 

What would be the best strategy to deal with this scenario?

Thanks!

Andrea

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/thinking-sphinx/-/G1wVI8Bh084J.
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