5 ms·
Dynamic Redis (which is a Redis Fork that lets you add modules to it) is a great find! Especially with the Geo module added. I needed a limit parameter for t
by Wouter33 11y ago
Dynamic Redis (which is a Redis Fork that lets you add modules to it) is a great find! Especially with the Geo module added.
I needed a limit parameter for the Georadius method because i wanted a result set sorted by distance in a large radius, but not have thousands of results send from the redis server to my webservers. Anyone interested in such a parameter can use my little fork for the Geo module:
https://github.com/wouter33/krmt https://github.com/wouter33/krmt
- antirez 11y agoGood idea, I'll add LIMIT. Makes sense to say I want N nearest elements with max distance of Y.
- Wouter33 11y agoGreat Salvatore! Could you make the max distance parameter optional? Sometimes i just want the nearest items, even though they could be on the other side of the world.
- Jake232 11y agoI feel like that is a fairly unusual usecase; plus you could just set the max distance parameter to the diameter of the Earth.
- Wouter33 11y agoOne of our applications has user generated content with a geolocation attached to each of the items. For several selections we want to show the top 10 nearest items. If they are only a few, the radius has to be very large to have some items in the result set. Currently the Geo module only supports a range up to 20.000 km. So your idea does not work at the moment. I agree that those items are not really "nearby", but to be consistent through out the application it would be nice to be able to select without a max distance.
- cwisecarver 11y agoI think the redis convention would be required and -1 gives you everything.