|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-28 12:48 UTC] jamie-lists at boxlightmedia dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 21:00:02 2025 UTC |
Description: ------------ When trying to sort using the magic attribute '@geodist' which should become available after setting a geo anchor, the client fails with an error that the attribute is not set. Reproduce code: --------------- <?php $client = new SphinxClient(); $client->setGeoAnchor('post_code_latitude', 'post_code_longitude', 51.494, -0.209); $client->setSortMode(SPH_SORT_ATTR_ASC, 'price'); var_dump($client->query('foo')); $client->setSortMode(SPH_SORT_ATTR_ASC', '@geodist'); var_dump($client->query('foo')); ?> Expected result: ---------------- Result 1: ["post_code_longitude"]=> float(51.4900016785) ["post_code_latitude"] => float(-0.209999993443) ["@geodist"] => float(10998531) Result 2: Same as Result 1 Actual result: -------------- Result 1: ["post_code_longitude"]=> float(51.4900016785) ["post_code_latitude"] => float(-0.209999993443) ["@geodist"] => float(10998531) Result 2: False, Error: sort-by attribute '@geodist' not found