package_search {ckanr} | R Documentation |
Search for packages.
Description
Search for packages.
Usage
package_search(
q = "*:*",
fq = NULL,
sort = NULL,
rows = NULL,
start = NULL,
facet = FALSE,
facet.limit = NULL,
facet.field = NULL,
facet.mincount = NULL,
include_drafts = FALSE,
include_private = FALSE,
use_default_schema = FALSE,
url = get_default_url(),
key = get_default_key(),
as = "list",
...
)
Arguments
q |
Query terms, defaults to ':', or everything. |
fq |
Filter query, this does not affect the search, only what gets returned |
sort |
Field to sort on. You can specify ascending (e.g., score desc) or descending (e.g., score asc), sort by two fields (e.g., score desc, price asc), or sort by a function (e.g., sum(x_f, y_f) desc, which sorts by the sum of x_f and y_f in a descending order). |
rows |
Number of records to return. Defaults to 10. |
start |
Record to start at, default to beginning. |
facet |
(logical) Whether to return facet results or not.
Default: |
facet.limit |
(numeric) This param indicates the maximum number of constraint counts that should be returned for the facet fields. A negative value means unlimited. Default: 100. Can be specified on a per field basis. |
facet.field |
(character) This param allows you to specify a field which should be treated as a facet. It will iterate over each Term in the field and generate a facet count using that Term as the constraint. This parameter can be specified multiple times to indicate multiple facet fields. None of the other params in this section will have any effect without specifying at least one field name using this param. |
facet.mincount |
(integer) the minimum counts for facet fields should be included in the results |
include_drafts |
(logical) if |
include_private |
(logical) if |
use_default_schema |
(logical) use default package schema instead of a
custom schema defined with an IDatasetForm plugin. default: |
url |
Base url to use. Default: https://data.ontario.ca/ See
also |
key |
A privileged CKAN API key, Default: your key set with
|
as |
(character) One of list (default), table, or json. Parsing with
table option uses |
... |
Curl args passed on to |
Examples
## Not run:
ckanr_setup(url = "https://demo.ckan.org", key=getOption("ckan_demo_key"))
package_search(q = '*:*')
package_search(q = '*:*', rows = 2, as = 'json')
package_search(q = '*:*', rows = 2, as = 'table')
package_search(q = '*:*', sort = 'score asc')
package_search(q = '*:*', fq = 'num_tags:[3 TO *]')$count
package_search(q = '*:*', fq = 'num_tags:[2 TO *]')$count
package_search(q = '*:*', fq = 'num_tags:[1 TO *]')$count
## End(Not run)