DKAN Docs
7.x-1.x
  • DKAN Overview
  • Installation
  • Major Components
    • Datasets
    • Datastore
    • Harvester
    • Workflow
    • Topics
    • Fixtures and Default Content
    • Federal Extras
    • Search
      • Search API
      • Apache Solr
        • DB vs Solr Search
        • Switching to Solr
      • Extending the Search Functionality
        • “Did You Mean?” Spellchecking
        • Searching within Resource files
    • Theme
    • Periodic Updates
    • Roles and Permissions
    • Storytelling
    • Open Data Schema Map
    • Visualizations
    • Link checker
  • DKAN Community
  • User Guide
  • Extending and Customizing DKAN
  • API Guide
  • Releases
  • License
DKAN Docs
  • Docs »
  • Major Components »
  • Search
  • Edit on GitHub

Search¶

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.

Search API¶

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.

Apache Solr¶

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.

Requirements:

  • Search API module
  • Search API Solr Search module
  • An Apache Solr server

For further details see the Search API Solr’s handbook documentation.

DB vs Solr Search¶

Solr:
  • PRO: Increased performance and scalability for complex queries.
  • PRO: Reduce database size.
  • CONS: Requires external service.
  • CONS: Increases hosting cost.
DB:
  • 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”
https://dkan-documentation-files.s3.us-east-2.amazonaws.com/dkan1/create_solr_server.png
  • After clicking “Create server” you should see a success message
https://dkan-documentation-files.s3.us-east-2.amazonaws.com/dkan1/create_solr_server1.jpg
  • Update the Dataset index to use the Solr server.
    • Go to admin/config/search/search_api
    • Select Edit on the datasets index
    • Select the solr server you just added
    • Click Save Settings
https://dkan-documentation-files.s3.us-east-2.amazonaws.com/dkan1/edit-search-index.png https://dkan-documentation-files.s3.us-east-2.amazonaws.com/dkan1/select-solr-server.png
  • Re-index your site admin/config/search/search_api/index/datasets.

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.

“Did You Mean?” Spellchecking¶

To add spellcheck, simply install the Search API Spellcheck

Searching within Resource files¶

PDFs, CSVs and other files attached to Resources can be searched by using the Tika library. This functionality is made possible with the Search API Attachments module

Tip

See the Search API Handbook for more recipes and information.

Next Previous

© Copyright 2019 Revision 9614216c.

Built with Sphinx using a theme provided by Read the Docs.