aroundLatLng
null
'aroundLatLng' => 'latitude, longitude' // A single pair of floats
Can be used in these methods:
search,
browseObjects,
deleteBy,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
delete_by,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browseObjects,
deleteBy,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
delete_by,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
deleteBy,
searchForFacetValues,
generateSecuredApiKey,
addAPIKey,
updateAPIKey
search,
browseObjects,
deleteObjectBy,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
Browse,
DeleteBy,
SearchForFacetValues,
GenerateSecuredApiKeys,
AddApiKey,
UpdateApiKey
Search,
browse,
deleteBy,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
BrowseObjects,
DeleteBy,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
browse index,
delete by,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
Enable geographic search within a circular area using a central location specified as a single pair of comma-separated latitude and longitude values.
Results are limited to records within a specified radius of the central location. Records closest to the central location will appear first in the results.
Usage notes
The circle’s maximum radius is determined by aroundRadius
.
The circle’s minimum radius is determined by minimumAroundRadius
The circle’s actual size is automatically computed based on the density of records near that point.
The radius is small if many hits are close to the central location.
The fewer hits near the center, the larger the radius.
If you set getRankingInfo
to true
, each result will include the distance from the center.
This parameter is ignored if you also specify insideBoundingBox
or insidePolygon
.
To base the central location on the user’s IP address, use aroundLatLngViaIP
instead.
Examples
Search around a position
1
2
3
$results = $index->search('query', [
'aroundLatLng' => '40.71, -74.01'
]);