[ckan-dev] List of datasets that have an URL link in their resource

Stefan Oderbolz odi at metaodi.ch
Thu Apr 18 08:23:45 UTC 2019


The fields you can use to search/filter with package_search are defined in
your solr schema. If you need additional fields, it's easy to extend the
schema and re-index your datasets. However for the case you describe the
standard schema should be enough.

In the default CKAN solr schema, there is a field called "res_type" that
coresponds to the "resource_type" field in the CKAN model.

For file uploads the value of this field is set to "file", so you could use
that to filter out all datasets containing a resource with the
resource_type "file" (note the "-" to exclude results that match):

fq=-res_type:file

E.g. for the City of Zurich portal:

https://data.stadt-zuerich.ch/api/3/action/package_search?fq=-res_type:file

- Stefan

On Thu, Apr 18, 2019, 05:51 Judith Moran <Judith.Moran at nt.gov.au> wrote:

> Hi,
>
>
>
> We need a list of dataset that have only resources that use a LINK.
>
>
>
> I have run this and see them in the list but don’t know the parameters to
> filter only resources that use a link (not the file option).
>
>
>
> curl 'http://opendata.nt.gov.au/api/3/action/package_search?fq=tags:*' >
> AllTags.xlsx
>
>
>
>
>
> Is there is fq for resources and further filter for those that have a URL
> link only?
>
>
>
>
>
> Regards,
>
>
>
>
>
>
>
> *Judy Moran*
> *Manager Data Strategy*
> Department of *Corporate and Information Services*
> Northern Territory Government of Australia
>
> *T:*  892 96550
> *E:*  DataStrategy.NTG at nt.gov.au
>
>
> _______________________________________________
> 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/20190418/cf830a18/attachment-0002.html>


More information about the ckan-dev mailing list