php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58967 Sorting by "@geodist" not working.
Submitted: 2009-11-28 12:14 UTC Modified: 2009-11-28 12:48 UTC
From: jamie-lists at boxlightmedia dot com Assigned:
Status: Closed Package: sphinx (PECL)
PHP Version: 5.2.10 OS: Gentoo Linux 2.6.27
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: jamie-lists at boxlightmedia dot com
New email:
PHP Version: OS:

 

 [2009-11-28 12:14 UTC] jamie-lists at boxlightmedia dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-28 12:48 UTC] jamie-lists at boxlightmedia dot com
Looks like I should be using SPH_SORT_EXTENDED for this type 
of query.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 02:03:13 2021 UTC