php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59253 Time taken in search result is incorrect
Submitted: 2010-06-06 00:06 UTC Modified: 2010-06-06 14:07 UTC
From: blueflycn at gmail dot com Assigned:
Status: Closed Package: sphinx (PECL)
PHP Version: 5.3.1 OS: CentOS 5.3
Private report: No CVE-ID: None
 [2010-06-06 00:06 UTC] blueflycn at gmail dot com
Description:
------------
I've tried sphinx extension and it is great and faster than pure PHP scripts API. I noticed that the time in search result was always 0 so I looked into the source code.

add_assoc_double_ex(*array, "time", sizeof("time"), result->time_msec/1000);

This line will always mostly return zero since both result->time_msec and 1000 are integer type (unless result->time_msec happened to be 1000, 2000 or so).

So change the above line to this;

add_assoc_double_ex(*array, "time", sizeof("time"), result->time_msec/1000.0);

and it will return the correct time in a float type.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-06 14:07 UTC] tony at daylessday dot org
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Fixed, thank you!
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 04:03:23 2021 UTC