DKAN offers a faceted search similar to CKAN. This functionality is provided by the Search API and Search API DB modules. DKAN can easily be updated to use Apache Solr to power the search using the Search API Solr module.
The Search API module provides a framework for easily creating searches on any entity known to Drupal, using any kind of search engine. It incorporates facet support and the ability to use the Views module for displaying search results.
Search API Solr Search provides a Solr backend for the Search API module, and delivers enterprise class, high performance search functionality. Apache Solr runs as a separate service from the web server and requires extra resources to integrate into your website. This can increase the price for hosting. Recommended for high traffic sites.
For further details see the Search API Solr’s handbook documentation.
DB vs Solr Search¶
- PRO: Increased performance and scalability for complex queries.
- PRO: Reduce database size.
- CONS: Requires external service.
- CONS: Increases hosting cost.
- PRO: All information is in the same database.
- PRO: Easy to set up.
- CONS: Poor performance for sites with high traffic.
- CONS: Increased database size if you have a lot data to index.
Switching to Solr¶
To switch from the native database to Solr simply:
- Create or purchase a Solr instance
- Install search_api_solr
- Go to Configuration -> “Search API” then “Add server”
- Enter a server name and under “Service class” select “Solr service”
- After clicking “Create server” you should see a success message
- Update the Dataset index to use the Solr server.
- Go to
- Select Edit on the datasets index
- Select the solr server you just added
- Click Save Settings
- Go to
- Re-index your site
Extending the Search Functionality¶
If you have the ability to add custom or contrib modules to your DKAN codebase, you can extend the search functionality in several ways. These modules may be added to DKAN core in the future but for now are not officially supported.