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
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:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC