aroundLatLng
null
'aroundLatLng' => 'latitude, longitude' // 2 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,
GenerateSecuredApiKey,
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
Search for entries around a central location, enabling a geographical search within a circular area.
A circle around the central location is automatically computed based on the density of records near that point. The radius will be small if many hits are close to the central location. The less hits near the center, the larger the radius will be.
Only records that fall within the bounds of this circle are returned.
Records are ranked according to their distance from the central location.
If you set getRankingInfo
to true
, each result will include the distance from the central location.
You can adjust the minimum and maximum radius:
- To determine maximum radius, use
aroundRadius
- To determine minimum radius, use
minimumAroundRadius
.
Usage notes
This parameter is ignored if used with 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'
]);