Skip to main content
  • Type: integer | list<object>
  • Default: 10
  • Min: 10
  • Scope: search
The aroundPrecision parameter controls how finely Algolia groups results by their distance from the search center. This affects how the Geo ranking criterion treats nearby records.

Usage

  • The geo criterion must be in your ranking formula (default behavior).
  • If you set a value below 10, Algolia uses 10 as the minimum.
  • Use an integer for a fixed grouping size in meters.
  • Use a list of range objects to define custom precision ranges based on distance bands.

Options

integer
Groups results by distance in fixed increments. For example, aroundPrecision: 100 means records from 0 to 99 m are ranked equally, as are 100 to 199 m, and so on.
list<object>
Provides variable precision at different distance ranges. Each object must include a from and a value. For example: [{ "from": 0, "value": 25 }, { "from": 1000, "value": 2000 }] means records between 0 and 999 m have a precision of 25 m, and records above 1,000 m have a precision of 2,000 m.

Examples

Specify a number

Current API clients

var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(
    new SearchParamsObject { Query = "query", AroundPrecision = new AroundPrecision(100) }
  )
);
index.Search(new Query("query")
{
    AroundPrecision = 100 // 100 meters precision
});

Specify range objects

Current API clients

var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(
    new SearchParamsObject
    {
      Query = "query",
      AroundPrecision = new AroundPrecision(
        new List<Range>
        {
          new Range { From = 0, Value = 25 },
          new Range { From = 2000, Value = 1000 },
        }
      ),
    }
  )
);
$results = $index->search('query', [
    'aroundPrecision' => [
        ['from' => 0, 'value' => 25], // 25 meters precision by default
        ['from' => 2000, 'value' => 1000] // 1,000 meters precision after 2 km
    ],
]);