Hi Julien

I think one of the issues is that you're dealing with a multi-value  
attribute - and Sphinx is only really friendly for those when they're  
integers. It's also not reliable for an exclusive filter - because  
while some of those values may match, others will not.

An alternative could be to create an association for the most recently  
updated association:

   has_one :recent_association, :class_name => "Association", :order  
=> "updated_at DESC"

And then have the following attribute:

   has recent_association.updated_at, :as => :last_association_update

And search as follows:

   Foo.search :without => {:last_association_update =>  
6.months.ago..Time.now}

Cheers

-- 
Pat

On 27/04/2009, at 8:08 AM, Julien Palmas wrote:

>
> Hi,
>
> My model Foo has_many :associations.
> Foo and Association models has the default rails Timestamps.
>
> Here is a part of my Foo index block :
>
>   define_index do
>
>     # indexes ...
>
>     has id, created_at, updated_at
>     has associations.updated_at, :as => : association_updated_dates
>
>     # other
>     set_property :delta => true
>   end
>
> I want to search for foos with no associations.updated_at after 6
> month ago.
>
> But this :
>
> Foo.search :without => {: association_updated_dates =>
> 6.month.ago..Time.now}
>
> returns an empty array, whatever the values in the
> association.update_at column ...
>
> Am I missing something here ?
>
> ++
> Ju
>
>
> >


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