chewy
chewy copied to clipboard
Chewy DSL - how to do a geo-type filter?
How do I filter for objects within, say, 'x' km of a specific longitude-latitude pair? In JSON I would use something like
geo_distance: { distance: "#{x}km", coordinates: { lat: "#latitude", lon: "#longitude" } }
but how do I express this in the Chewy DSL?
Never mind - I figured it out. I can do something like this:
filter(geo_distance: {distance: "25km", coordinates: {lat: <latitude>, lon:<longitude>}})
Perfect :+1: