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

James Casbon casbon at gmail.com
Fri Apr 27 10:20:03 UTC 2012


On 26 April 2012 23:38, Rufus Pollock <rufus.pollock at okfn.org> wrote:
>
> On 26 April 2012 16:52, James Casbon <casbon at gmail.com> wrote:
> > 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.
>
snip
>
> simple answer is: no :-)
>
> We intentionally return exactly what ElasticSearch gives us so that
> you can a) use libraries designed for ES with CKAN Data API b) you can
> switch seamlessly between CKAN data API and ES (if you want to work
> locally).
>
> I know it is slightly annoying but it's a tiny amount of data and you
> can just do data.hits to get the stuff immediately.


I think this is wrong because:
1. I don't care about ES, I wanted to use CKANs API and I normally
expect things to be simple where they can be (i.e. RESTish).
2. If I can just return hits, then you can.  One place (on the server)
versus all the places (on the clients).
3. You are committing yourself to maintain the ES metadata if you drop
ES as a backend, otherwise you will break the clients (this is a bad
design decision IMO)

Also, I would really like it to be able to just get the resource
without any limits.  This would work for most small datasets.
ie http://thedatahub.org/api/data/b9aae52b-b082-4159-b46f-7bb9c158d013/
should not return 'No handler found for uri
[/ckan-www.ckan.net/b9aae52b-b082-4159-b46f-7bb9c158d013/] and method
[GET]\

It should return the JSON representation of the resource or a paging
link if the resource is too large
http://stackoverflow.com/questions/924472/paging-in-a-rest-collection




More information about the ckan-dev mailing list