sphinxQL fetching random?

橙三吉。 提交于 2020-01-03 04:51:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!