问题
In SphinxQL, how do I get random records from index?
SELECT fname FROM indexname WHERE Age>=21 and Age<=47 random 0,4 \G;
Getting following error:
sphinxql: syntax error, unexpected CONST_INT, expecting BETWEEN (or 8 other tokens) near '0,4
Any other way to getting random record from SphinxQl?
回答1:
All you need is
... ORDER BY RAND() LIMIT 4
来源:https://stackoverflow.com/questions/15434291/sphinxql-fetching-random