Hi Daniel Unfortunately, this is a limitation in Sphinx. It stores the timestamps as unsigned integers - so it doesn't allow for times before the epoch. The same limitation exists in database functions to generate timestamps from datetime values as well.
It's been discussed on the list before, but we've not found an easy solution thus far. I guess one option could be to convert dates into YYYYMMDD format, then from that into an integer, and store that as the birthdate. This loses the granularity around hours and minutes, but maybe that's acceptable (else could add them onto the end of the date- to-string-to-int). Sorry I don't have a simple solution for you. -- Pat On 21/07/2009, at 11:38 PM, [email protected] wrote: > > Hi Group, > > I am having a problem when searching with TS. The following query > returns results: > > Profile.search :with => { :birthdate => 20.years.ago..Time.now } > > But this returns no results! > > Profile.search :with => { :birthdate => 40.years.ago..Time.now } > > I notice that when converting the timestamps to ints the second query > has a negative value for the range start. I also noticed that a 0 on > the range start works but as soon as there is a negative epoch (ie; > before 1970-01-01) TS fails to return any results. > > Profile.search :with => { :birthdate => 0...1248228518 } => Lots of > records > > Profile.search :with => { :birthdate => -1...1248228518 } => NOTHING! > > It looks like Riddle bungles the query string somewhere but not sure > how to fix it. > > > Anyone have any ideas? > > Daniel > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
