leerssej / freebase-python

Automatically exported from code.google.com/p/freebase-python
Other
0 stars 0 forks source link

search() function is missing some parameters #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The freebase.search() function is missing some parameters -- specifically 
type_exclude at http://www.freebase.com/docs/web_services/search#limiting, but 
there may be others. Since passing extra parameters to Freebase APIs doesn't 
seem to do any harm, I suggest this definition of search():

@json_params
def search(self, query, **kwargs):
    service = "/api/service/search"
    form = dict(query=query)
    form.update(kwargs)
    return self._mqlresult(self._httpreq_json(service, 'POST', form=form))

This has the advantage that further parameters added in the future will 
continue to work. 

Original issue reported on code.google.com by stuart.l...@gmail.com on 18 Oct 2010 at 11:01

GoogleCodeExporter commented 9 years ago
Thanks Stuart, i've made your suggested changes to search & geosearch. 

Original comment by rtp@google.com on 19 Oct 2010 at 5:53

GoogleCodeExporter commented 9 years ago

Original comment by rtp@google.com on 19 Oct 2010 at 5:53

GoogleCodeExporter commented 9 years ago

Original comment by rtp@google.com on 19 Oct 2010 at 5:54