Hi Gordon Sorting randomly is certainly an option, using :order => "RAND()”.
However, it seems that it only works as the lone ordering argument. In my tests locally, Sphinx throws an error when trying to order by attributes and RAND(), so I have a feeling you’re not going to be able to do what you want in a single query. Perhaps worth asking the Sphinx team via their forum, though I wouldn’t expect any changes in the near future to Sphinx’s behaviour: http://sphinxsearch.com/forum/ <http://sphinxsearch.com/forum/> Cheers, — Pat > On 29 Jun 2017, at 5:19 am, Gordon B. Isnor <[email protected] > <mailto:[email protected]>> wrote: > > We're using TS ~ 3.3.0, with SQL-backed indices > > A client is looking for results with the following sort order: > > - records with images first in random order > - then records with no images, also in random order > > I see that older versions of TS and Sphinx offered a @random option, and it > looks like Sphinx still has an extended sort mode, but in reviewing the > documentation and code case I can't find anything pertaining to sort mode. > I've also tried selecting RANDOM() as r and then sorting on that, but also > could not get that working. > > > > -- > 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] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/thinking-sphinx > <https://groups.google.com/group/thinking-sphinx>. > For more options, visit https://groups.google.com/d/optout > <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 https://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/d/optout.
