How I search datasets by multiple tags using CKAN API?

1.1k Views Asked by At

I'm using CKAN portal with API version "ckan_version": "2.5.x" I have few tags and I need to send using API these tags and I need to return a list of matching entries of packages or resources.

Is possible to use do use package_search endpoint to search for packages with all given tags, but it works as "AND" operator, and that I need is a "OR" operator. e.g.:

PS: I used top 10 tags (http://demo.ckan.org/api/action/package_search?facet.field=[%22tags%22]&facet.limit=10&rows=0).

I think it have relation with SOLR and postgresql index. There is a way to do that? If not, Is possible to extend or create a facet that make possible use this kind of search?

2

There are 2 best solutions below

1
On BEST ANSWER
0
On

If not using the API, then entering the search words separated by | and no spaces seems to work e.g. blue|red would return datasets with blue or red. e.g. dark blue|red also seems to work if one of the terms has a space in it.