aroundLatLng

Type: string
Engine default: null
Parameter syntax
'aroundLatLng' => 'latitude, longitude' // 2 floats
Parameter syntax
aroundLatLng: 'latitude, longitude' # 2 floats
Parameter syntax
aroundLatLng: 'latitude, longitude' // 2 floats
Parameter syntax
'aroundLatLng': 'latitude, longitude' # 2 floats
Parameter syntax
"aroundLatLng": "latitude, longitude" // 2 floats
Parameter syntax
.setAroundLatLng("latitude, longitude") // 2 floats
Parameter syntax
.AroundLatitudeLongitude(lat, long) // 2 floats
Parameter syntax
.setAroundLatLng("latitude, longitude") // 2 floats
Parameter syntax
"aroundLatLng": "latitude, longitude", // 2 floats
Parameter syntax
aroundLatLng = Some("latitude, longitude") // 2 floats

Can be used in these methods:
search, browseObjects, deleteBy, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, browse, delete_by, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, browse, deleteBy, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, browse, delete_by, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, browse, deleteBy, searchForFacetValues searchAsync, browseAsync, deleteByAsync, searchForFacetValues Search, Browse, DeleteBy, SearchForFacetValues, GenerateSecuredApiKey, AddApiKey, UpdateApiKey Search, browse, deleteBy, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey Search, Browse, DeleteBy, SearchForFacetValues, GenerateSecuredAPIKey, AddAPIKey, UpdateAPIKey search, browse index, delete by, search into facet values, generateSecuredApiKey, add key, update key

About this parameter

Search for entries around a central geolocation, enabling a geo search within a circular area.

By defining this central point, there are three consequences:

  • a radius / circle is computed automatically, based on the density of the records near the point defined by this setting
  • only records that fall within the bounds of the circle are returned
  • records are ranked according to the distance from the center of the circle

Usage notes:
  • With this setting, you are defining a central point of a circle, whose geo-coordinates are expressed as two floats separated by a comma.

  • Note: This setting differs from aroundLatLngViaIP, which uses the end-user’s IP to determine the geo-coordinates.

  • This parameter will be ignored if used along with insideBoundingBox or insidePolygon

  • To control the maximum size of the radius, you would use aroundRadius.

  • To control the minimum size, you would use minimumAroundRadius.

Examples

Search around a position

<?php
$results = $index->search('query', [
  'aroundLatLng' => '40.71, -74.01'
]);
results = index.search('query', {
  aroundLatLng: '40.71, -74.01'
})
index.search({
  query: 'query',
  aroundLatLng: '40.71, -74.01'
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
  'aroundLatLng': '40.71, -74.01'
})
let query = Query(query: "query")
query.aroundLatLng = LatLng(lat: 40.71, lng: -74.01)

index.search(query, completionHandler: { (res, error) in
  print(res)
})
index.search(
  new Query("query")
    .setAroundLatLng(
      new LatLng(40.71, -74.01)
    )
);
index.search(
  new Query("query")
    .AroundLatitudeLongitude(40.71f, -74.01f)
);
index.search(
  new Query("query")
    .setAroundLatLng("40.71, -74.01")
);
res, err := index.Search("query", algoliasearch.Map{
  "aroundLatLng": "40.71, -74.01",
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    aroundLatLng = Some(
      AroundLatLng("40.71, -74.01")
    )
  )
}
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