|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-06 14:07 UTC] tony at daylessday dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 07:00:01 2025 UTC |
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.