Search additional datasets by your query using CKAN package_search API similar to harvester(url from ckan.search_federation
). If
count of found datasets less than ckan.search_federation.min_search_results
federation search will add additional results below
local results from dataportals that set in ckan.search_federation
field at your config file. If field ckan.search_federation
not set than additional search will not run.
To install ckanext-searchfed:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-searchfed Python package into your virtual environment:
pip install ckanext-searchfed
Add
searchfed
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
).Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Label and URL for sites where search can take data (if empty default value = {}). This labels will appears to the left of dataset title additional results. For example Label =
FROM DATA.BRISBANE.GOV.AU
, URL =https://data.brisbane.qld.gov.au/data
:ckan.search_federation = data.brisbane.gov.au https://data.brisbane.qld.gov.au/data data.gov.au http://data.gov.au
Also use with ckan.search_federation labels for filter query (if empty default value = ""). For example ['data.brisbane.gov.au', 'data.gov.au', 'data.sa.gov.au']:
ckan.search_federation.label = data.sa.gov.au
Use for filter query when fetch data. In result we will have filter query for search for example
-harvest_portal:data.brisbane.gov.au
(if empty default value = 'harvest_portal'):ckan.search_federation.extra_keys = harvest_portal search_federation_portal
If true and 'search_facets' in remote search results we will use remote search facets instead local facets (if empty default value = False):
ckan.search_federation.use_remote_facet_results = false
If local results is less than
ckan.search_federation.min_search_results
value, searchfed will run and added more datasets below local results (if empty default value = 20):ckan.search_federation.min_search_results = 3
If true - results for API search include remote datasets. If false - only local datasets are included into API search results
ckan.search_federation.api_federation = false
To install ckanext-searchfed for development, activate your CKAN virtualenv and do:
git clone https://github.com//ckanext-searchfed.git cd ckanext-searchfed python setup.py develop pip install -r dev-requirements.txt