Skip to contents

Returns the result object of the Search API as a nested list (count, results, facets, ...).

Usage

de_search(
  q = NULL,
  filters = "dataset",
  facets = NULL,
  limit = 10,
  page = 0,
  sort = NULL,
  country = NULL,
  catalog = NULL,
  format = NULL,
  license = NULL,
  category = NULL,
  publisher = NULL,
  keywords = NULL,
  hvd = NULL,
  min_date = NULL,
  max_date = NULL,
  date_type = NULL,
  bbox = NULL,
  aggregation = FALSE,
  extra = list()
)

Arguments

q

Free-text query.

filters

Document type: "dataset" (default), "catalogue", "dataservice", "resource"...

facets

Named list of facet filters, e.g. list(country = "pt").

limit

Results per page (0-1000).

page

Zero-based page.

sort

e.g. "modified+desc".

country, catalog, format, license, category, publisher, keywords, hvd

Convenience facet filters. country takes ISO-2 codes, format ids like "CSV", category DCAT-AP theme codes ("ENVI").

min_date, max_date, date_type

Date range; date_type one of issued, modified, temporal.

bbox

Numeric c(min_lon, min_lat, max_lon, max_lat) in WGS84 degrees. A dataset matches when its spatial extent overlaps the box, so datasets covering all of Europe or the world match any box. Datasets without a spatial extent (about half the portal) never match.

aggregation

Return facet counts?

extra

Named list of additional raw query parameters.

Value

The result object of the response, a nested list with count, results (the records), facets when aggregation = TRUE, and scrollId in scroll mode.

Details

With limit = 0 the result can come from the response cache (see de_cache_on()).

Examples

if (FALSE) { # interactive()
res <- de_search("air quality", country = "pt", limit = 5)
res$count
de_pick_lang(res$results[[1]]$title)
}