> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Geo ranking information

> The data Algolia uses for geographical ranking.

export const SearchQuery = () => <Tooltip tip="The text users enter into a search box. In the Search API, this corresponds to the query parameter. A search query is often used with filters, facets, and other parameters, but these aren't part of the query text itself.">
    search query
  </Tooltip>;

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](/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision)
or [tweak your geographical settings](/doc/guides/managing-results/refine-results/geolocation).

To get geo-ranking data, you need to set [`getRankingInfo=true`](/doc/api-reference/api-parameters/getRankingInfo) 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 <SearchQuery />.
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).

<Note>
  `lat` and `lng` are Algolia's internal values, not the original `_geoloc` on the record. Returned values may show fewer decimals than the values you indexed. For background, see [Geographical ranking precision](/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision).

  Unlike `geoDistance`, the `distance` value isn't divided by geographical precision.
</Note>

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 JSON icon=braces theme={"system"}
{
    "_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}`
