_geojson field, allowing you to index complex shapes like polygons and multi-polygons in addition to simple point coordinates.
Use GeoJSON when your documents represent areas (neighborhoods, properties, delivery zones) rather than single points.
The _geojson field
To use GeoJSON, add a _geojson field to your documents. The value must follow the GeoJSON specification.
Point geometry
For simple point locations, you can use either the_geo field or a GeoJSON Point:
Polygon geometry
Use a Polygon to represent an area like a neighborhood, a property boundary, or a delivery zone:Meilisearch does not support polygons with holes. If your polygon includes an inner ring (a hole), Meilisearch ignores the hole and treats the polygon as a solid shape.
MultiPolygon geometry
Use a MultiPolygon when a single document covers multiple separate areas:Filtering and sorting with GeoJSON documents
Filtering works the same way with GeoJSON documents as with_geo documents. Add _geo to filterableAttributes, then use _geoRadius, _geoBoundingBox, or _geoPolygon in your search queries.
_geojson Polygon or MultiPolygon, Meilisearch checks whether the filter area intersects with the document’s geometry.
Using _geo and _geojson together
If your application needs both distance-based sorting and polygon-based filtering, add both fields to your documents:
- Uses
_geofor sorting with_geoPoint - Uses
_geojsonfor filtering with_geoPolygon - Matches both
_geoand_geojsonvalues when filtering with_geoRadiusand_geoBoundingBox
Limitations
- Transmeridian shapes are not supported. If your shape crosses the 180th meridian, split it into two separate shapes grouped as a
MultiPolygonorMultiLine. - Polygons with holes are not supported. Meilisearch ignores inner rings and treats polygons as solid shapes.
- CSV files do not support
_geojson. Use JSON or NDJSON format for documents with GeoJSON data.
Geo search overview
Learn about all geo search capabilities, including
_geo and _geojson.GeoJSON specification
Official GeoJSON format documentation.