_geoRadius filter returns documents located within a circular area defined by a center point and a radius. This is the most common geo filter, useful for “find nearby” features like store locators, restaurant finders, or service area lookups.
Syntax
| Parameter | Type | Description |
|---|---|---|
lat | Float | Latitude of the center point |
lng | Float | Longitude of the center point |
distanceInMeters | Integer | Radius of the search area in meters |
2000 for a 2 km radius or 500 for 500 meters.
Filter by radius
The following example searches for restaurants within 2 km of central Milan (latitude 45.472735, longitude 9.184019):_geo location inside the specified circle:
Understanding _geoDistance
When you use _geoRadius, Meilisearch automatically includes a _geoDistance field in each result. This value represents the distance in meters between the document’s location and the center point of your radius filter.
_geoDistance is a computed field that only appears in search results. It is not stored in your documents and cannot be used as a filter.Combine with other filters
You can combine_geoRadius with any other filter using AND and OR operators. The following example finds only pizzerias within 2 km of central Milan:
Common radius values
| Use case | Radius |
|---|---|
| Walking distance | 1000 (1 km) |
| Short drive | 5000 (5 km) |
| City-wide | 15000 (15 km) |
| Regional | 50000 (50 km) |
Geo search overview
Learn about all geo search capabilities in Meilisearch.
Search API reference
Full reference for the search endpoint and filter parameter.