HI all,

I have a problem I'm hoping someone can help me with.  I've setup TS
to index a couple of my models and am using a datetime delta to handle
model updates.  This is all working great.  The problem I'm having is
that I need to remove a model from being searchable based on a field
in a child, so the paren't datetime doesn't get update when the childs
field changes.  Here is what my indexed model looks like

class Picture < ActiveRecord::Base
  has_many :comments

  define_index do
    set_property :delta => :datetime, :delta_column
=> :updated_at, :threshold => 30.minutes

    indexes :title
    indexes comments.comment

    has comments.moderated, :as => :comments_moderated
  end

end

and I search for models using:

Picture.search(params[:q], :without => {:comments_moderated => false}}

This way, search only finds pictures that have all their comments
moderated.

The problem is, adding or moderating a comment doesn't change the
updated_at field in picture, so my delta index doesn't pick up the
fact that a picture should (or not) be found by my above search.

Any ideas on how I can go about resolving this?  I'd rather not have
to update the pictures updated_at field when saving a comment.  Is
there anyway to maybe get delta datetime to take into account the
child's datetimes as well?

Thanks,

Matt


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