What version of TS are you using? There's been a tweak lately to fix up time 
zone handling, but it's not yet been put into a new gem release (though you 
could grab the source and run 'rake build' to generate a bleeding edge gem if 
you want, or just install TS as a plugin).

Even with that in mind, TS doesn't have any smarts for Date objects in filters 
- you will need to either convert it to a timestamp integer, or to a Time 
(which then in turn gets translated into a timestamp integer automatically by 
TS).

Cheers

-- 
Pat

On 16/06/2010, at 4:32 PM, Christian Aust wrote:

> Hi all,
> 
> how do I correctly index and filter by a date attribute?
> 
> Project.published_at => Date
> 
>  define_index do
>    # ...
>    has published_at, :as => :published_at, :type => :datetime
>    # ...
>  end
> 
> Project.search :with=>{:published_at=>Date.today}
> 
> gives me incorrect results. What am I doing wrong? Regards,
> 
> Christian
> 
> -- 
> 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.
> 

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