package_search
Searches for packages satisfying a given search criteria.
This action accepts Solr search query parameters (details below), and returns a dictionary of results, including dictized datasets that match the search criteria, a search count, and also facet information.
Solr Parameters:
For more in depth treatment of each parameter, please read the Solr Documentation.
This action accepts a subset of Solr's search query parameters.
The following advanced Solr parameters are supported as well. Note that some of these are only available on particular Solr versions. See Solr's dismax and edismax documentation for further details on them:
qf, wt, bf, boost, tie, defType, mm
Examples:
q=flooddatasets containing the word flood, floods, or floodingfq=tags:economydatasets with the tag economyfacet.field=["tags"] facet.limit=10 rows=0top 10 tags
Title
There is an issue for the Body dropdown within this UI where an empty object {} is set for the facet field.
Please either remove this field by clicking "Open JSON editor" in the Body dropdown or set it to true (the default value) or false.
CKAN API token
In: header
the solr query.
any filter queries to apply. Note: +site_id:{ckan_site_id} is added to this string prior to the query being executed.
additional filter queries to apply.
sorting of the search results. Default: 'score desc, metadata_modified desc'. As per the Solr documentation, this is a comma-separated string of field names and sort-orderings.
the maximum number of matching rows (datasets) to return. (default: 10, upper limit: 1000 unless set in site's configuration ckan.search.rows_max)
the offset in the complete result for where the set of returned datasets should begin.
whether to enable faceted results. Default: True
the minimum counts for facet fields should be included in the results.
the maximum number of values the facet fields return. A negative value means unlimited. This can be set instance-wide with the search.facets.limit config option. Default is 50.
the fields to facet upon. Default empty. If empty, then the returned facet information is empty.
if True, draft datasets will be included in the results. A user will only be returned their own draft datasets, and a sysadmin will be returned all draft datasets. Optional, the default is False.
if True, deleted datasets will be included in the results (site configuration ckan.search.remove_deleted_packages must be set to False). Optional, the default is False.
if True, private datasets will be included in the results. Only private datasets from the user’s organizations will be returned and sysadmins will be returned all private datasets. Optional, the default is False.
use default package schema instead of a custom schema defined with an IDatasetForm plugin (default: False)
curl -X POST "http://localhost:5000/api/3/action/package_search" \ -H "Content-Type: application/json" \ -d '{}'