API Reference / API Parameters / aroundPrecision
Feb. 26, 2019

aroundPrecision

Type: integer
Engine default: 1
Parameter syntax
'aroundPrecision' => number_of_meters

Can be used in these methods:

About this parameter

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).

Examples

Set geo search precision

1
2
3
$results = $index->search('query', [
  'aroundPrecision' => 100 // 100 meters precision
]);

Did you find this page helpful?