OK. Found the solution...
My rails app was configured correctly with utc, but my mysql server used
the timezone of my local dev machine, which was CEST...
In my created_at field I had a datetime value in utc but the
thinking_sphinx select query to generate the index used UNIX_TIMESTAMP
which used the timezone of the mysql server (CEST) for casting the datetime
value to the unix timestamp... in the end thinking sphinx query compared to
different timestamps/integers....
Solution was to set the default_timezone of the mysql server to 'UTC' and
regenerate the index. Afterwards everything worked.
Govinda
Am Mittwoch, 10. April 2013 12:59:34 UTC+2 schrieb Govinda Fichtner:
>
> Hello guys,
>
> I am having a hard time with the following search query:
>
> Image.search("", :conditions => { "category" => "user_images"}, :star =>
> true, :with => { "client_id" => 6, :created_at =>
> 1.hour.ago..Time.zone.now})
>
> I expect this search query to return one image I created some minutes
> ago... but I get none.
>
> When I change the query to:
>
> Image.search("", :conditions => { "category" => "user_images"}, :star =>
> true, :with => { "client_id" => 6, :created_at =>
> 3.hours.ago..Time.zone.now})
>
> ...I get the expected result.
>
> I am using Rails 3 & Active Record so the time is saved in utc...
>
> How is Thinking Sphinx handling the timezone stuff? Are there any
> differences between ThinkingSphinx 2 and 3?
> Do I have to make some conversions manually?
>
> Cheers,
>
> Govinda
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.