Hi Ravi Firstly, the ORDER BY NULL in the generated SQL is for MySQL only, and is because the order of results in Sphinx does not matter - plus, it turns out specifying NULL as the order, instead of not specifying any ORDER clause at all, returns records more quickly in MySQL.
There is nothing within Thinking Sphinx that allows for custom ORDER clauses, I'm afraid - but it looks like you can specify the custom order within a GROUP_CONCAT call: http://stackoverflow.com/a/995383/54500 So, if you make that change in your SQL snippet for the attribute, you should be good to go. Cheers -- Pat On 22 Jul 2014, at 11:01 pm, [email protected] wrote: > I am trying to add a group_concat a field on a 1-m association which will be > added as an attribute so that I can access this attribute in the search > results to avoid executing the sql again. > > here is my attribute, > has "GROUP_CONCAT(DISTINCT provider_specialties.name SEPARATOR ', ')", :as > => :specialties_list, :type => :string > > where I am accessing it in the search results using > sphinx_attributes['specialties_list'] > > but when I am doing this GROUP_CONCAT, I wanted to specify order by on the > provider_specialties table join. > > no matter I do on the define index, I am not able to get the "ORDER BY > provider_specialties.isprimary DESC" while generating the attribute by > group_concat. > > any ideas? > > > > > > > > -- > 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/d/optout. -- 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/d/optout.
