API Reference / API Parameters / aroundRadius
Type: integer | "all"
Engine default: null
Parameter syntax
'aroundRadius' => radius_in_meters|'all'

Can be used in these methods:

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 _geoloc attribute. 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

radius_in_meters

Integer (in meters) that sets the radius around the coordinates in your query.

all

Skips radius filtering. Returns all results with a valid _geoloc attribute, regardless of distance.

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'
]);
Did you find this page helpful?