Hi Greg

The best approach is to add an after_save callback on Step, that  
updates the lesson's delta to true and saves it. Hopefully that should  
do the trick.

Cheers

-- 
Pat

On 06/01/2009, at 8:36 PM, Greg DeVore wrote:

>
> It seems that delta indexing does not work on associated tables.  Here
> is what I have:
>
> Lesson model:
>
> define_index do
>   indexes title
>   indexes description
>   indexes steps.title, :as => :step_titles
>   indexes steps.instructions, :as => :step_instructions
>   has account_id
>   set_property :delta => true
> end
>
> Step is a different model.  I have added delta fields to both the
> Lesson and Step tables.
>
> If I modify a lesson attribute Shpinx picks it up. But if I modify a
> step attribute Sphinx doesn't pick it up.  Exampes:
>
> If I modify a lesson title to "Thiss Lesson"
> Lesson.search "Thiss" returns the result.
>
> But if I modify the first step of that lesson so that the step title
> is "Annother step"
> Lesson.search "Annother" doesn't return anything.
>
> I have also tried adding this to my step model:
>
> define_index do
>   indexes title
>   indexes instructions_search
>   has lesson_id
>   set_property :delta => true
> end
>
> Modifying the step attribute rotates the step index but doesn't update
> the lesson index. So now Lesson.search("Annother") doesn't return
> anything but Step.search("Annother") returns the step.
>
> How can I trigger the lesson index when a step is modified?
>
> Thanks,
> Greg DeVore
> >


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