> ## 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 search

> Learn how to index location data inside Django models.

Use the `geo_field` attribute to add coordinates your record.
It should be a callable that returns a tuple (latitude, longitude).

```python Python icon=code theme={"system"}
class Contact(models.model):
    name = models.CharField(max_lenght=20)
    lat = models.FloatField()
    lng = models.FloatField()

    def location(self):
        return (self.lat, self.lng)


class ContactIndex(AlgoliaIndex):
    fields = "name"
    geo_field = "location"


algoliasearch.register(Contact, ContactIndex)
```
