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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: blueflycn at gmail dot com
New email:
PHP Version: OS:

 

 [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-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 27 03:03:34 2022 UTC