bcgov / bcdata

An R package for searching & retrieving data from the B.C. Data Catalogue
https://bcgov.github.io/bcdata
Apache License 2.0
82 stars 12 forks source link

Expand bcdc_search() to be able to search with AND, OR, or exact string, and use tags #14

Open stephhazlitt opened 5 years ago

stephhazlitt commented 5 years ago

Allow terms to be passed as a vector, and allow use of | for OR

ateucher commented 5 years ago

A few example cli curl commands for searching:

# search for 'forest', with facets: download audience public, format is xls or shp
curl https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=forest+download_audience:Public+res_format:\(xls%20OR%20shp\)

# search for children AND health (order and adjacency don't matter)
curl https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=children%20health
# Also works (same thing):
curl https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=children+health

# search for children OR health (note escaping the |)
curl https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=children\|health

# search for water with stateofenvironment tag:
curl https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=water+tags:stateofenvironment

# search for exact string 'regional district' (note escaping the quotes)
curl https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=\"regional%20district\"
boshek commented 3 years ago

Additional functionality from #58: Convert output of bcdc_search to a data frame instead of a list

ateucher commented 3 years ago

There may be more options with the search API vs action/package_search