[ckan-dev] package_search by organisation name

Matthew Fullerton matt.fullerton at gmail.com
Tue Dec 18 11:29:08 UTC 2018


Hi Andy,

I hate to say, but I don't think that's possible because that is stored
against or indexed with the packages (datasets). It would be possible to
make this happen with a plugin, but I think that doesn't help you with your
problem?

Best,
Matt

On Tue, 18 Dec 2018 at 12:15, Andy Lulham <a.lulham at gmail.com> wrote:

> 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
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20181218/23d6f063/attachment-0002.html>


More information about the ckan-dev mailing list