从Sphinx查询获取50个随机行

从Sphinx查询获取50个随机行

问题描述:

我有一个通过 sphinxClient lib 使用Sphinx的PHP网站.

I have a PHP website using Sphinx by sphinxClient lib.

我的Sphinx查询具有一些过滤器,并且限制为2500行.从2500行(可能会更少)中,我只想获取50个随机行.

My Sphinx query has some filters and a limit of 2500 rows. From the 2500 rows (could be less), I want to fetch just 50 random rows.

是否有一种仅使用狮身人面像的方法?

Is there a way to do it using only Sphinx?

原始查询已经按行的受欢迎程度进行了排序,主要思想是从2500个最受欢迎的产品中获取50个随机产品.因此,我无法随机排序

The original query already sorted by the popularity of the rows, the main idea is to get 50 random products from the 2500 most popular. Because of that I can't sort by random

使用RAND()限制50的订单有什么问题

What's the issue with using order by RAND() limit 50

检查此链接以获取类似结果. sphinxQL随机获取?

Check this link for similar result. sphinxQL fetching random?