hbz / oerworldmap.prototype

OER World Map Prototype
2 stars 4 forks source link

Allow geospatial filtering of search results #34

Closed literarymachine closed 10 years ago

literarymachine commented 10 years ago

The API should supply a means to filter search results by location. For now, querying by bounding box (instead of e.g. the distance to a given point) should be sufficient.

fsteeg commented 10 years ago

When the data supports Elasticsearch geolocation filters (see [1], ping @dr0i), the API could provide an additional location query parameter. With that, something like &location="40,-70; 30,-80; 20,-90" would be mapped internally to a filter as in [2].

[1] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html [2] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-filter.html#_lat_lon_as_string_5

fsteeg commented 10 years ago

Or would point + distance be more useful for you @literarymachine? Like: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-filter.html#_lat_lon_as_string_4 e.g. with API like &location="40,-70;12km"

literarymachine commented 10 years ago

No, I don't believe physical distance is really important here. The bounding box is good because I can then only request those resources that are actually needed for the current map section.

fsteeg commented 10 years ago

Ready for review @literarymachine

Sample query: http://staging.api.lobid.org/oer?q=*&location=40.8,-86.6+40.8,-88.6+42.8,-88.6+42.8,-86.6

literarymachine commented 10 years ago

Sometimes I get lost as to where to confirm. +1, like here https://github.com/hbz/oerworldmap/issues/33

fsteeg commented 10 years ago

@literarymachine yeah, like we discussed in our last meeting, we'll relax the review workflow. No more pull request reviews, only +1 on the actual issues from now on.