setAroundPrecision method

AlgoliaQuery setAroundPrecision(
  1. int value
)

AroundPrecision

Precision of geo search (in meters), to add grouping by geo location to the ranking formula.

When ranking hits, geo distances are grouped into ranges of aroundPrecision size. All hits within the same range are considered equal with respect to the geo ranking parameter.

For example, if you set aroundPrecision to 100, any two objects lying in the range [0, 99m] from the searched location will be considered equal; same for [100, 199], [200, 299], etc.

Usage notes:

  • For this setting to have any effect, the geo criterion must be included in your ranking formula (which is the case by default).

1 = 1 Meter

Therefore for 1000 = 1 Kilometer

'aroundPrecision' => 1000 // 1km

Source: Learn more

Implementation

AlgoliaQuery setAroundPrecision(int value) {
  assert(!_parameters.containsKey('aroundPrecision'));
  return _copyWithParameters(<String, dynamic>{'aroundPrecision': value});
}