aroundRadius
"all"
null
'aroundRadius' => radius_in_meters|'all'
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
Set the maximum radius for a geo search (in meters).
Usage notes
This setting applies only to radial (circular) geo searches using
aroundLatLngViaIP or aroundLatLng.
How the radius is calculated
- If you set a radius in meters, Algolia returns only records within that circle. Results are ranked by their distance from the central point.
- If you use
all, Algolia skips radius-based filtering and returns all records with a valid_geolocattribute. Ranking is based on proximity to the central point. This option is faster than setting a large radius value.
If you don’t set a radius but perform a radial geo search using aroundLatLngViaIP or aroundLatLng,
Algolia calculates the radius automatically based on the density of the area.
See also minimumAroundRadius,
which sets the minimum size of the radius.
To affect ranking, the geo criterion must be included in your ranking formula (this is the default).
Options
|
Integer (in meters) that sets the radius around the coordinates in your query. |
|
Skips radius filtering.
Returns all results with a valid |
Examples
Set manual radius filtering
1
2
3
4
$results = $index->search('query', [
'aroundLatLng' => '40.71, -74.01',
'aroundRadius' => 1000 // 1km
]);
Turn off automatic radius filtering
1
2
3
4
$results = $index->search('query', [
'aroundLatLng' => '40.71, -74.01',
'aroundRadius' => 'all'
]);