我刚刚在我的服务器上安装了 SphinxQL 供应商(我是新手),但我遇到了一个问题 - 我找不到通过随机选择使脚本工作的方法。
这是我的代码:
require "./classes/vendor/autoload.php";
use Foolz\SphinxQL\SphinxQL;
use Foolz\SphinxQL\Connection;
// create a SphinxQL Connection object to use with SphinxQL
$conn = new Connection();
$conn->setParams(array('host' => '127.0.0.1', 'port' => 9306));
$query = SphinxQL::create($conn)->select('*')
->from('documents_titles')
->match('title','welcome')
->orderBy('title', $direction = 'RAND()');
$result = $query->execute();
var_dump($result);
我尝试了很多方法让它随机但没有运气。