Open fergalwalsh opened 8 years ago
Btw, currently we don't store any geo-data.. so I'm looking for guidance from you on the best way we should store it.
I do want to know the city, state and country for any geo-point tho.. or of course if we don't even have a point, we just have a "place" we need to make it all work too.
the geo work is all greenfield for us.. so hopefully you can guide us on it
the shape was just one of my naive ideas.. perhaps we dont need if you can achieve what I describe in the README
@pkieltyka I did some reading and experimenting with Elastic Search for geo searches. These are my findings:
Requirements as discussed:
The Problem: How do we store the geo info?
Two relevant type of geo fields:
geo_point
- a simple lat,lon pairgeo_shape
- aPoint
/Polygon
/Envelope
(bounding box)/Circle
geo_point
supports filtering by Distance or by Bounding Box and sorting by Distance (using_geo_distance
)geo_shape
supports filtering by othergeo_shape
s (e.g. all shapes within a circle or bounding box) but it does not support sorting at all.The unfortunate result here is that neither field type satisfies both requirements.
Possible Solutions
geo_point
) with the Hub.geo_shape
for denoting the hub target area and ageo_point
as the centroid of this area to use for sorting (finding nearest N)