Open ken678 opened 2 years ago
[root@instance-eegfzl7f php]# util/Quest.php cms --query="公司 AND modelid:3" --limit 0,5 在 20 条数据中,大约有 6 条包含 公司 AND modelid:3 ,第 1-5 条,用时:0.0022 秒。
[root@instance-eegfzl7f php]# util/Quest.php cms --query="公司 AND modelid:3" --limit 0,10 在 20 条数据中,大约有 9 条包含 公司 AND modelid:3 ,第 1-9 条,用时:0.0026 秒。
这个问题一直到现在还存在
几百条几千条以上有误差还过得去,几条都有这么大误差
这是 xapian 的机制所致,如果只是为了得到精确的计数,可以通过 setLimit() 并传入一个较大的 offset
[root@instance-eegfzl7f php]# util/Quest.php cms --query="公司 AND modelid:3" --limit 0,5 在 20 条数据中,大约有 6 条包含 公司 AND modelid:3 ,第 1-5 条,用时:0.0022 秒。
[root@instance-eegfzl7f php]# util/Quest.php cms --query="公司 AND modelid:3" --limit 0,10 在 20 条数据中,大约有 9 条包含 公司 AND modelid:3 ,第 1-9 条,用时:0.0026 秒。