hbz / oerworldmap.prototype

OER World Map Prototype
2 stars 4 forks source link

Support queries by country label via separate geonames documents and parent-child queries #99

Closed fsteeg closed 10 years ago

fsteeg commented 10 years ago

See #98

Deployed to staging: http://staging.api.lobid.org/oer

All fields in the geonames data are used by the filter, so different languages are supported:

http://staging.api.lobid.org/oer?q=*&location=germany http://staging.api.lobid.org/oer?q=*&location=deutschland http://staging.api.lobid.org/oer?q=*&location=ドイツ

literarymachine commented 10 years ago

I would have expected queries such as

http://staging.api.lobid.org/oer?q=deutschland

to deliver results. Not sure if an extra location-param is needed here. Interestingly enough, the above query delivers data about geonames-features. Is that correct?

fsteeg commented 10 years ago

Since the country labels are not in the actual OER documents but in the geonames documents, the q= queries return the geonames documents. The location= parameter returns the corresponding OER document (which isn't new BTW but was previously only used for coordinates, see http://staging.api.lobid.org/oer).

fsteeg commented 10 years ago

Fix to return only OER resources on /oer queries deployed to staging:

http://staging.api.lobid.org/oer?q=deutschland http://staging.api.lobid.org/oer?q=*&location=deutschland

literarymachine commented 10 years ago

which isn't new BTW but was previously only used for coordinates

Right, I have been using it in that way.

As for the labels in the index: I think that including a country name in a query (q-param) is a fairly common use-case, similar to using an author's name when looking for a resource.

fsteeg commented 10 years ago

Deployed implicit addition of q= parameter value as location= if no location= is given.

@literarymachine this should yield the behaviour you expect:

http://staging.api.lobid.org/oer?q=deutschland

fsteeg commented 10 years ago

Redeployed to aither, now running on Elasticsearch 1.1.0. Play also running on aither, port 7001. Staging proxy on emphytos updated to point to aither, so this should make no difference for using the OER API.

acka47 commented 10 years ago

+1