bcdata icon indicating copy to clipboard operation
bcdata copied to clipboard

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

Open stephhazlitt opened this issue 7 years ago • 3 comments

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

stephhazlitt avatar Dec 21 '18 22:12 stephhazlitt

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\"

ateucher avatar Jan 07 '19 22:01 ateucher

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

boshek avatar Mar 24 '21 15:03 boshek

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

ateucher avatar Sep 20 '21 23:09 ateucher