Hi Pat, I have forked TS and made the required changes in my branch which now fixes the datetime MVA issue.
This includes making sure datetime mvas are casted to UNIX_TIMESTAMP and that they are correctly separated with commas (using :type => :datetime does not separate them with commas). I sent you a couple (sorry) pull requests but I have not sent you one for the final changes as I fixed another small bug I found in my implementation. I have not made any rspec tests as I am not an rspec man (I need to change that) but just yell out if you need this before the changes can be committed. Also, if you see something I have not taken into account please yell out. Thanks a bundle for all your work on TS! Josh On Jul 1, 6:23 pm, Pat Allan <[email protected]> wrote: > On 01/07/2009, at 11:09 AM, Josh K wrote: > > > I will try and put a patch together soon, but could you answer two > > quick questions, does it affect the query at all if the MVA is > > Distinct or not? > > I'm not sure if Sphinx or MySQL/PostgreSQL is faster at filtering out > duplicates, but it doesn't matter either way. > > > and is it better to use commas as the separators or > > spaces? > > Commas are required as separators for MVAs. > > Cheers > > -- > Pat > > > On Jul 1, 4:30 pm, Pat Allan <[email protected]> wrote: > >> It's kinda-expected behaviour. Sphinx doesn't handle date MVA's, only > >> integers. Of course, dates are stored as timestamp integers, so > >> there's no reason for it not to work in theory. It's a known bug, and > >> if you'd like to submit a patch to fix it, that'd be fantastic :) > > >> Cheers > > >> -- > >> Pat > > >> On 01/07/2009, at 9:59 AM, Josh K wrote: > > >>> Hi, > > >>> I am building a small app which has two main models, Productions and > >>> Performances. The performances model has start and end datetime > >>> info, > >>> while the production is kind of a grouping. > > >>> Anyhow, as I was putting together a sphinx query for the > >>> production I > >>> noticed that > > >>> has performances(:start), :as => :performance_start > > >>> was creating incorrect sql for the sql query in the conf file. > >>> Instead > >>> of creating a concat list of unix timestamps, it was just using the > >>> datetimes with no converting eg. > > >>> GROUP_CONCAT(DISTINCT `performances`.`start` SEPARATOR ' ') AS > >>> `performance_start` > > >>> This was fixed by using :type => :datetime (although it took me a > >>> while to find this solution, the problem solving took me longer), > >>> but > >>> the concat is using spaces as separators instead of commas, unlike > >>> other concat lists of ids, although I don't know if this is a > >>> problem > >>> or not. > > >>> Is this a bug which I should log an issue or submit a patch for? > >>> or is > >>> this expected behavior? > > >>> Thanks a bundle > > >>> Josh --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
