Skip to main content
When you use Algolia’s Geo feature, you can get information about each record’s geographical ranking. This information can be useful to detect bad or missing geographical data, and can indicate whether you need to adjust precision or tweak your geographical settings. To get geo-ranking data, you need to set getRankingInfo=true in your query parameter. Doing this adds two new attributes to _rankingInfo: matchedGeoLocation and aroundLatLng.

matchedGeoLocation attribute

The matchedGeoLocation attribute contains geographical information, including the location that matched when you were performing a . By using this information, you’ll be able to identify the geo-location that was used and to retrieve some associated information like the name. matchedGeoLocation is a geographical location object that matches the query. It consists of:
  • lat (float): latitude of matched location
  • lng (float): longitude of matched location
  • distance (integer): distance between the matched location and the search location (in meters).
Unlike geoDistance, the distance value isn’t divided by geographical precision.
Here’s an example of _rankingInfo attribute returned on a record with several geo-location (the matchedGeoLocation attribute will be in _rankingInfo only if a geographical query is performed):
JSON
{
    "_rankingInfo": {
        "nbTypos": 0,
        "firstMatchedWord": 0,
        "proximityDistance": 0,
        "userScore": 7,
        "geoDistance": 1600,
        "geoPrecision": 1,
        "nbExactWords": 0,
        "words": 0,
        "filters": 0,
        "matchedGeoLocation": {
            "lat": 37.3688,
            "lng": -122.036,
            "distance": 1600
        }
    }
}

aroundLatLng attribute

aroundLatLng (string, optional):
  • Only returned when aroundLatLngViaIP is set
  • Computed geographical location
  • Legacy reason (param is a string not an object): ${lat}, ${lng}
Last modified on February 4, 2026