[ckan-dev] package_search by organisation name

Andy Lulham a.lulham at gmail.com
Tue Dec 18 11:14:46 UTC 2018


Thanks Matthew! That perfectly answers my question!

Unfortunately, it turns out I got my question slightly wrong :(

I’m actually interested in searching by the organisation _title_, not
_name_. Both would also be fine, but I really need a way to ensure the
organisation title is included in the search.

So for example, using your solution the following works, because
there’s an organisation with the name “organizacion-de-pepe-foo”:
https://demo.ckan.org/api/3/action/package_search?q=organization:%22organizacion-de-pepe-foo%22

The same organisation has the title “organizacion de pepe foo”. But
the following search doesn’t work, presumably because it’s not
searching the organisation title field:
https://demo.ckan.org/api/3/action/package_search?q=organization:%22organizacion%20de%20pepe%20foo%22

In case it’s useful, the relevant ticket is here:
https://github.com/pwyf/iati-decipher/issues/93

Thanks again Matthew, and apologies for my error.

Andy


On Tue, 18 Dec 2018 at 05:44, Matthew Fullerton
<matt.fullerton at gmail.com> wrote:
>
> https://demo.ckan.org/api/3/action/package_search?q=organization:opendata_rco
>
> Seems to do it
>
> -Matt
>
> On Mon, 17 Dec 2018 at 18:49, Andy Lulham <a.lulham at gmail.com> wrote:
>>
>> Hi there,
>>
>> The following API URL returns various packages, including one from an
>> organisation named “opendata_rco”:
>> https://demo.ckan.org/api/3/action/package_search
>>
>> I’d like to create an API query that just returns the package(s) from
>> this organisation.
>>
>> I guess this query would be something like:
>> https://demo.ckan.org/api/3/action/package_search?q=organization:name=
>> opendata_rco
>>
>> …but that’s obviously not quite right, since it returns zero results.
>>
>> Could someone enlighten me as to the correct query? Thanks in advance!
>>
>> Andy
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev



More information about the ckan-dev mailing list