duannaozhao4626 2016-05-12 12:45
浏览 143

sphinx没有返回所有结果

I am using the SphinxClient() object in php (using sphinx api for php)

this is my code:

$cl = new SphinxClient();
$cl->SetServer( "localhost", 3312 );
$cl->SetMatchMode   ( SPH_MATCH_ALL );
$cl->SetSortMode    ( SPH_SORT_RELEVANCE );

$cl->SetArrayResult( true );

$cl->AddQuery( $sphinxQuery, $sphinxIndex, 'Search' );

$cl->SetLimits      ( 0, 1000, 1000 );

$result = $cl->RunQueries();

but the result I get contains only 50 matches, although it does show that total is more

Array
(
    ...
    [matches] => Array
    (
        [0] => Array
        (
            [id] => 91855
            ...
        )

        [1] => Array
        (
            ...
        )

        ...

        [49] => Array
        (
            ...
        )

    )

    [total] => 1000
    [total_found] => 1920
    [time] => 0.000
    [words] => Array
    (
        [584] => Array
        (
            [docs] => 2067
            [hits] => 2067
        )

    )

)

As you can see that it shows 0 to 49 matches (i.e. 50 matches) while the limit is 1000

And also you can see that the total is 1000 and total_found is 1920, which means there are more results than just 50 but it is not just returning them

Is there some other setting in sphinx that reduces the number of matches output

May be there is some setting introduced in some version of sphinx and it has a default value of 50...?

Any help will be appreciate..!

  • 写回答

1条回答 默认 最新

  • doujia1871 2016-05-12 12:48
    关注

    maybe you should change the SetLimits to more than 1000

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?