downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SphinxClient::setGroupBy> <SphinxClient::setFilterRange
[edit] Last updated: Fri, 25 May 2012

view this page in

SphinxClient::setGeoAnchor

(PECL sphinx >= 0.1.0)

SphinxClient::setGeoAnchorConfigure le point d'origine pour les calculs géographiques

Description

public bool SphinxClient::setGeoAnchor ( string $attrlat , string $attrlong , float $latitude , float $longitude )

Configure le point d'origine pour les calculs géographiques.

Une fois que l'origine est configurée, vous pouvez utiliser l'attribut magique "@geodist" dans vos filtres et vos expressions de tri.

Liste de paramètres

attrlat

Nom de l'attribut de latitude.

attrlong

Nom de l'attribut de longitude.

latitude

Latitude d'origine en radians.

longitude

Longitude d'origine en radians.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.



add a note add a note User Contributed Notes SphinxClient::setGeoAnchor
michel dot bartz at igotchamedia dot com 20-Jul-2011 07:17
For this to work, attrlat and attrlng need to be in lower case otherwise you will get :
"unknown latitude attribute ''"
k dot andris at gmail dot com 07-Oct-2010 12:55
When sorting on @geodist you have to use SetSortMode with SPH_SORT_EXTENDED, like below, if SPH_SORT_ATTR_ASC does not seem to work.

$sphinx->SetSortMode(SPH_SORT_EXTENDED, '@geodist ASC');

 
show source | credits | stats | sitemap | contact | advertising | mirror sites