-
Notifications
You must be signed in to change notification settings - Fork 518
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
[FR] Query optional for geo use cases in FT.SEARCH #136
Comments
It would require designing a syntax to allow the geofilter to get into the query language, like the numeric filters. I'm not so sure about how to express it syntactically. |
Ok, how about this for the syntax of geo queries @stockholmux: since a numeric query is expressed as How about we express radius clauses like this:
e.g.
So having it as optional will look like:
And you can also combine it any other way - in unions, negative clauses, intersection with other geo fields, whatever. Of course it will usually be abstracted by the client library, but I still want a clear and simple syntax for this. WDYT? |
I think that makes a lot of sense. My only question would be if you executed something like this:
I assume the query syntax would take precedent over the geofilter? It might need a little explanation in documentation since they seem very close in application. |
I will deprecate the keyword once I've put it in the query string I guess, and advise against using the keyword. |
And it's not a question of precedence - they will both apply and you will get the intersection of the two filters. If there is no overlap you will get no results. |
It's been merged into master, syntax is |
Let's say I have 20 widgets scattered around a field. These widgets have certain characteristics (colour, name, whatev) I want searchable, so I use RediSearch and have a
location
field. Normally, I want to be able to find these widgets by colour and use thisFT.SEARCH widgets "@colour:blue" GEOFILTER location -113.48 53.56 10 m
But sometimes I don't care about those characteristics and I just want to find all the widgets, so my query argument could be empty but that isn't possible.
I can accomplish this with a dirty hack:
FT.SEARCH widgets "~x" GEOFILTER location -113.48 53.56 10 m
(x doesn't appear any any of the data... so everything)I imagine this is not intended to work. Seems like something along the lines of:
FT.GEOONLYSEARCH widget location -113.48 53.56 10 m
or
FT.SEARCH widgets GEOONLY location -113.48 53.56 10 m
Would be the way to address this use case
(I know that
geo:widgets/location
is just a zset/geo store, but the members are meaningless).The text was updated successfully, but these errors were encountered: