aroundPrecision

scope search
type integer
default 1
description

Precision of geo search (in meters).

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.

Examples

Set geo search precision

<?php
$results = $index->search('query', [
  'aroundPrecision' => 100 // 100 meters precision
]);
results = index.search('query', {
  aroundPrecision: 100 # 100 meters precision
})
index.search({
  query: 'query',
  aroundPrecision: 100 // 100m
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
    'aroundPrecision': 100 # 100 meters precision
})
let query = Query(query: "query")
query.aroundPrecision = 100

index.search(query, completionHandler: { (res, error) in
    print(res)
})
index.search(new Query("query").setAroundPrecision(100)); // 100 meters precision
index.search(
  new Query("query").setAroundPrecision(100)
);
index.search(
  new Query("query").setAroundPrecision(100) //100 meters
);
res, err := index.Search("query", algoliasearch.Map{
    "aroundPrecision": 100, // 100 meters precision
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    aroundPrecision = Some(100)
  )
}
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala