A really nifty bit of indexing you can do with Redis OM is geo-indexing. To GeoIndex, all you need to do is to mark a
GeoLoc field in your model as
Indexed and create the index
So let's create the index and seed some data.
With our data seeded, we can now run geo-filters on our restaurants data, let's say we had an office (e.g. Redis's offices in Mountain View at
-122.064224,37.377266) and we wanted to find nearby restaurants, we could do so by using a
GeoFilter query restaurants within a certain radius, say 1 mile we can: