The error occurs either way. I modified it so that it's @weight and that works. Thanks for your help.
--------------------------------------------------------- Ahmed El-Daly Chief Guru DeveloperGurus Inc. on budget, on time T: 416-566-4945 | developergurus.com On 2013-01-17, at 9:05 AM, "Pat Allan" <[email protected]> wrote: > That error doesn't seem to quite match the query - are you sorting by @rank > or custom_rank? Or does the error occur either way? Perhaps SphinxQL doesn't > understand @rank - but it should be fine with @weight, which is the same > thing. > > That said - you're also sorting with the SQL statement - why bother with the > Sphinx sort order at all? > > (And that SQL ordering should be done like so in v3: :sql => {:order => > 'vintage_year DESC'} ) > > Cheers > > -- > Pat > > On 17/01/2013, at 2:38 AM, Daly wrote: > >> Good morning, >> >> This used to work fine: >> options = {:retry_stale => true, :sort_mode => :extended, :order => '@rank >> DESC', :per_page => 1000000, :sql_order => 'vintage_year DESC'} >> options.merge!(:per_page => 10, :page => page) if use_pagination >> results = Wine.search(string, options) >> >> After the upgrade, it complains with: >> Mysql2::Error: sphinxql: syntax error, unexpected USERVAR, expecting IDENT >> (or 5 other tokens) near '@rank DESC LIMIT 0, 10; SHOW META' >> >> I tried this: >> options = { >> :retry_stale => true, >> :sort_mode => :extended, >> :select => '*, @rank as custom_rank', >> :order => :custom_rank, >> :per_page => 1000000, >> :sql_order => 'vintage_year DESC' >> } >> >> and that produces: >> Mysql2::Error: index wine_core: parse error: Sphinx expr: syntax error, >> unexpected TOK_USERVAR near '@rank' >> >> What's the proper way of specifying this in the new version? >> >> Thanks. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Thinking Sphinx" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/thinking-sphinx/-/8rDDG7z8mP0J. >> 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. > -- 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.
