[ckan-dev] [ckan-discuss] Fwd: Problems running curl

David Raznick kindly at gmail.com
Wed May 23 08:35:12 UTC 2012


Hello,

I am moving this conversation to ckan-dev as its more appropriate here and
more devs will look at it.

This looks like a bug.  The get query parameters are not being passed on
correctly to elastic search.

We cannot allow vanilla elastic search as we have to do some gate keeping
and have to analyze the query parameters before we send them on.

However, as you have correct rights over the dataset, using your api key
you can post to that endpoint.  (notice no --get)

curl http://thedatahub.org/api/data/4e256209-7e2d-4481-9627-da73e191baf2/_search?pretty=true
-d '{"query":{"match_all:{}}}' -H 'Authorization: your-api-key'

(replace your-api-key from http://thedatahub.org/user/me)

This works for me.  We will raise a ticket about the other error.

David




On Wed, May 23, 2012 at 12:27 AM, Alexandre Gomes <alegomes at gmail.com>wrote:

> Some queries doesn't work with CURL. Guess why?
>
>
> ---------- Forwarded message ----------
> From: Shay Banon <kimchy at gmail.com>
> Date: Sun, May 20, 2012 at 5:07 PM
> Subject: Re: Problemas running curl
> To: elasticsearch at googlegroups.com
>
>
> I Am not really sure how CKAN converts the API calls to elasticsearch, but
> your samples should work with vanilla ES. The body query for example looks
> good.
>
>
> On Thu, May 17, 2012 at 9:25 PM, Alexandre Gomes <alegomes at gmail.com>wrote:
>
>> Hi all.
>>
>> I'm trying to recover information from [1]. TheDataHub.Org portal is
>> based on CKAN [2], an open data platform, and, as stated in [3], it uses
>> ElasticSearch underneath.
>>
>> The schema is available at [4].
>>
>> I'm having problems performing queries at the command line.
>>
>> As you can see, q=Tema:aeroportos works fine [5]. However,
>> source='{"query":{"match_all":{}}}' only works on web browser [6], and
>> the same thing happens with '{"query":{"term":{"Tema":"aeroportos"}}}'[7]
>>
>> What am I missing?
>>
>> [1] http://thedatahub.org/dataset/copa-2014
>> [2] http://ckan.org/
>> [3] http://docs.ckan.org/en/latest/using-data-api.html
>> [4] https://gist.github.com/2721069#file_mapping
>> [5] https://gist.github.com/2721069#file_q_tema_aeroportos
>> [6] https://gist.github.com/2721069#file_query_match_all
>> [7] https://gist.github.com/2721069#file_query_term_tema_aeroportos
>>
>> thanks a lot
>>
>
>
>
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120523/ec284449/attachment.html>


More information about the ckan-dev mailing list