|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58357 setLimits says max_matches is optional, but leaves an error
Submitted: 2008-09-30 08:51 UTC Modified: 2008-09-30 09:09 UTC
From: iwanowski dot martin at gmail dot com Assigned:
Status: Not a bug Package: sphinx (PECL)
PHP Version: Irrelevant OS: Debian 4.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: iwanowski dot martin at gmail dot com
New email:
PHP Version: OS:


 [2008-09-30 08:51 UTC] iwanowski dot martin at gmail dot com
Using SphinxClient::setLimits($offset, $limit, $max_matches, 

Documentation states the $max_matches is optional.

Complete newbie that I am, looking at the source 
$max_matches is auto set to 0, by definition unlimited. 
Using this value will result in an error:

per-query max_matches=0 out of bounds (per-server 

If $max_matches is left out by the user, it should be set to 
whatever value is in sphinx.conf.

Or perhaps I got this all wrong?

Reproduce code:
$s = new SphinxClient;
$s->setLimits(0, 20);
$result = $s->query('test');
echo $s->getLastError();

Expected result:
As the documentation states 
( the 
limit is optional, and should be set to whatever the 
sphinx.conf is set to if $max_matches is left out by the user.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-30 08:56 UTC] tony at daylessday dot org
That's an issue in libsphinxclient, not in PECL/sphinx.
And AFAIK it's already been fixed, at least it was reported to the maintainer about a month ago.
 [2008-09-30 09:09 UTC] iwanowski dot martin at gmail dot com
Sorry about this, didn't think of it as a bug in libsphinxclient.

It's still open in the bug-tracker at
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Nov 26 09:04:15 2022 UTC