_geoPolygon filter returns documents located within a custom polygon shape. Use this for irregular geographic boundaries like delivery zones, school districts, or custom sales territories that cannot be represented by a simple circle or rectangle.
Syntax
You must provide at least 3 coordinate pairs to define a valid polygon. Meilisearch automatically closes the polygon by connecting the last point back to the first, so you do not need to repeat the starting coordinate.
Filter by polygon
The following example defines a triangular delivery zone in central Milan and searches for restaurants within it:- Northwest corner: 45.490, 9.170
- Northeast corner: 45.490, 9.210
- South center: 45.450, 9.190
Define complex shapes
You can use as many points as needed to define complex boundaries. For example, a five-sided delivery zone:Combine with other filters
You can combine_geoPolygon with any other filter using AND and OR operators:
_geoPolygon with _geoRadius or _geoBoundingBox for more precise geographic targeting:
Geo search overview
Learn about all geo search capabilities in Meilisearch.
Search API reference
Full reference for the search endpoint and filter parameter.