-
Notifications
You must be signed in to change notification settings - Fork 1.5k
GEOSEARCH & GEOSEARCHSTORE #2089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This matches GeoRadius today and while not as efficient, is much simpler to maintain in this high-args count case. We can always revisit, but relative to the cost of a search I'd opt for simpler code in this case.
@slorello89 Alrighty I hacked away at this a bit today - awesome work coming in. A few overalls:
|
@NickCraver - regarding the overload names, I'm getting an RS0026 whenever I try to add anything lol, running into the same problem with
I think it's a either stylistic type warning that was somehow promoted to an error(maybe with all the nullable stuff?), or a bug in roslyn. I can suppress them and get it to build, but don't think that's particularly wise. thoughts? |
They'll go away once the API is added to PublicAPI.Shipped.txt, but they're sometimes legit...and sometimes bogus, I've hit a lot of cases with that analyzer. I'll be sure to poke ZMPOP more, but you shouldn't be seeing it in this PR! |
@NickCraver ahh jeeze - yep that was it, as soon as I added them to the shipped API vs the unshipped they were happy, odd but at least workable lol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current is looking good - thanks!
Dammit, forgot to check the Release notes - will add. |
@NickCraver
This PR implements
GEOSEARCH
andGEOSEARCHSTORE
for #2055To abstract the box/circle sub-options from GEOSEARCH I added a new abstract class
GeoSearchShape
who's children are responsible for maintaining the bounding shape, its unit of measurement, the number of arguments required for the sub-option, and of course the sub-option name. Rather than casting/extracting the arguments, I have it use an IEnumerable state-machine with yield/return. Wasn't sure which was the better option, the IEnumerable seemed cleaner, open to whichever you want.I changed the
GEORADIUS
pattern of having aGeoSearch(key, member, args. . .)
and aGeoSearch(key, lon, lat, args. . .)
, and instead haveGeoSearchByMember
andGeoSearchByCoordinates
. If I'm honest, it was because my IDE was complaining about breaking compatibility rules by having more than 1 override with optional parameters, not sure if you have a strong feeling on this.Tried to maintain the single array-allocation pattern you added to #2075