What if you could find any place nearby in seconds without checking every address yourself?
Why Geo-point and geo-shape types in Elasticsearch? - Purpose & Use Cases
Imagine you have a huge list of addresses and you want to find all places within 5 miles of your home. Doing this by hand means checking each address one by one on a map.
Manually checking locations is slow and mistakes happen easily. It's hard to calculate distances or find shapes like areas or routes without special tools. This wastes time and can give wrong results.
Geo-point and geo-shape types let you store locations and shapes directly in Elasticsearch. This means you can quickly search, filter, and analyze places by distance or area with simple commands.
for location in locations: if distance(location, home) < 5: print(location)
{
"mappings": {
"properties": {
"location": { "type": "geo_point" }
}
}
}
{
"query": {
"geo_distance": {
"distance": "5mi",
"location": "40,-70"
}
}
}You can instantly find all points or shapes near a location or inside an area, making location-based searches fast and accurate.
A delivery app uses geo-point to find all drivers within 3 miles of a customer, and geo-shape to check if a delivery address is inside a service zone.
Manual location checks are slow and error-prone.
Geo-point and geo-shape types store locations and shapes efficiently.
This enables fast, accurate geographic searches and filters.