Skip to content
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

Specify location based searches #289

Closed
aaghevli opened this issue Jun 13, 2017 · 6 comments
Closed

Specify location based searches #289

aaghevli opened this issue Jun 13, 2017 · 6 comments

Comments

@aaghevli
Copy link

Neither ODATA nor OSDI specify proximity searches. In Resistance Calendar we implemented the following API to support that.

# If distance_coords are used, we ignore distance_postal_code and distance_city
http://resistance-calendar.herokuapp.com/v1/events?distance_coords=[-98.435508,29.516496]&distance_max=10000

# If distance_postal_code are used, and not distance_coords, then distance_city is ignored
http://resistance-calendar.herokuapp.com/v1/events?distance_postal_code=94110&distance_max=10000

# distance_city is used if neither distance_postal_code nor distance_coords are provided
http://resistance-calendar.herokuapp.com/v1/events?distance_city=Albuquerque&distance_max=10000
@joshco
Copy link
Contributor

joshco commented Jun 13, 2017

@aaghevli See http://opensupporter.github.io/osdi-docs/#filtering-collections OSDI does actually define a filter function 'near' .

@aaghevli
Copy link
Author

aaghevli commented Jun 13, 2017

Ah thanks! I was not aware of those and can investigate that a bit more. I am happy to close this until I get a better idea of that API.

One question is how we know what the first parameter is supposed to be?

gender eq ‘Female’ and near(‘10011’, ‘5 miles’)

The first parameter looks like a zip code, but that seems a bit loosely specified. Is that supposed to include the parameter name (e.g. address.postal_code near(‘10011’, ‘5 miles’)).

@joshco joshco reopened this Jun 15, 2017
@schuyler1d
Copy link
Contributor

fwiw, we have a second implementation (of resistance calendar's version) here:
MoveOnOrg/eventroller#33

@schuyler1d
Copy link
Contributor

Also, I have a slightly different question than @aaghevli -- can 'near' also be anything besides a zip? how do you do near() with a lat/long or city? Some additional examples in the spec would help

@j-ro
Copy link
Contributor

j-ro commented Jul 6, 2017

I think right now it probably only means zip, since we don't specify the field name in the near syntax. This is probably a good area for further work too -- a way to do near on other fields, for example.

@sonyabea
Copy link
Contributor

closed by committee 9/19/2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants