php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
Using SphinxClient::setLimits($offset, $limit, $max_matches, 
$cutoff).

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 
max_matches=1000)

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:
---------------
<?php
$s = new SphinxClient;
$s->setLimits(0, 20);
$result = $s->query('test');
echo $s->getLastError();
?>

Expected result:
----------------
As the documentation states 
(http://php.net/manual/en/sphinxclient.setlimits.php) 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.


Patches

Pull Requests

History

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 sphinxsearch.com:
http://sphinxsearch.com/bugs/view.php?id=208
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 15:01:31 2025 UTC