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
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: 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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC