[ckan-dev] ckan api: remove ES stuff?

James Casbon casbon at gmail.com
Thu Apr 26 15:52:57 UTC 2012


Hi All,

First of all thanks for fixing the CORS requests issues that were
preventing me using the data api in a JS app.  But... is it possible to
remove (what looks like) the search meta information from the results.

ie.

>>> url = '
http://thedatahub.org/api/data/b9aae52b-b082-4159-b46f-7bb9c158d013/_search?size=5
'
>>> import json, urllib
>>> pprint(json.loads(urllib.urlopen(url).read()))
{u'_shards': {u'failed': 0, u'successful': 5, u'total': 5},
 u'hits': {u'hits': [{u'_id': u'MdbtPhg8Q3WVM6gGw2tMVQ',
                      u'_index': u'ckan-www.ckan.net',
                      u'_score': 1.0,
                      u'_source': {u'__id__': u'51',
                                   u'date': u'1954-03',
                                   u'price': u'34.92'},
                      u'_type': u'b9aae52b-b082-4159-b46f-7bb9c158d013'},
...

Would look like:
>>> pprint(json.loads(urllib.urlopen(url).read()))
 [ {u'__id__': u'51',
    u'date': u'1954-03',
    u'price': u'34.92'},
...


Thanks,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120426/0a54bd30/attachment.html>


More information about the ckan-dev mailing list