aroundPrecision
1
'aroundPrecision' => number_of_meters
Can be used in these methods:
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
searchAsync,
browseAsync,
searchForFacetValues
Search,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
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, 99]
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
]);