欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

coreseek 的php搜索接口结果总数和匹配数不相同

程序员文章站 2022-05-23 16:40:48
...
使用coreseek做全文搜索,结果如下:

Array ( [error] => [warning] => [status] => 0 [fields] => Array ( [0] => content ) [attrs] => Array ( ) [matches] => Array ( [27] => Array ( [weight] => 1 [attrs] => Array ( ) ) [28] => Array ( [weight] => 1 [attrs] => Array ( ) ) [32] => Array ( [weight] => 1 [attrs] => Array ( ) ) [34] => Array ( [weight] => 1 [attrs] => Array ( ) ) [35] => Array ( [weight] => 1 [attrs] => Array ( ) ) [38] => Array ( [weight] => 1 [attrs] => Array ( ) ) [42] => Array ( [weight] => 1 [attrs] => Array ( ) ) [45] => Array ( [weight] => 1 [attrs] => Array ( ) ) [49] => Array ( [weight] => 1 [attrs] => Array ( ) ) [52] => Array ( [weight] => 1 [attrs] => Array ( ) ) [53] => Array ( [weight] => 1 [attrs] => Array ( ) ) [55] => Array ( [weight] => 1 [attrs] => Array ( ) ) [61] => Array ( [weight] => 1 [attrs] => Array ( ) ) [70] => Array ( [weight] => 1 [attrs] => Array ( ) ) [71] => Array ( [weight] => 1 [attrs] => Array ( ) ) [72] => Array ( [weight] => 1 [attrs] => Array ( ) ) [74] => Array ( [weight] => 1 [attrs] => Array ( ) ) [75] => Array ( [weight] => 1 [attrs] => Array ( ) ) [76] => Array ( [weight] => 1 [attrs] => Array ( ) ) [82] => Array ( [weight] => 1 [attrs] => Array ( ) ) ) [total] => 1000 [total_found] => 2931 [time] => 0.005 [words] => Array ( [我] => Array ( [docs] => 2931 [hits] => 6974 ) ) )

为什么total是1000,但是matches匹配出来的只有20条记录?


回复讨论(解决方案)

sphinxapi.php里设置_maxmatches值

客户端调用:
$cl = new SphinxClient ();
$cl->setLimits(0, 500000);