Hi Max
This is a bug in Riddle that I’ve just fixed. Add the following to your Gemfile
and it should work smoothly:
gem ‘riddle’, ‘~> 1.5.9’,
:git => ‘git://github.com/pat/riddle.git',
:branch => ‘develop’,
:ref => ‘01d35a37b8’
Cheers
—
Pat
On 29 Oct 2013, at 6:41 pm, Max NudePatch <[email protected]> wrote:
> Hello.
> I want to get some random results.
> Model.search :order => 'RAND()'
> produces => SELECT * FROM `table` WHERE `sphinx_deleted` = 0 ORDER BY
> `RAND()` LIMIT 0, 20
> Which return error => ThinkingSphinx::SyntaxError: sphinxql: syntax error,
> unexpected $undefined, expecting IDENT (or 6 other tokens) near '`RAND()`
> LIMIT 0, 20; SHOW META'
>
> Direct query without backquotes runs fine
> SELECT * FROM `table` WHERE `sphinx_deleted` = 0 ORDER BY RAND() LIMIT 0, 20
>
> So how do I manage this? Or should I use riddle instead?
> (anyway, whould be nice to know if there is option to disable wrapping)
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.