The Search API Database Search module provides a database backend for Search API. It uses database tables for indexing content. In this video, I will show you how to install and enable Search API Database Search and how to create a new server using the database service.

Install Modules

Enable Modules

  • Go to "Modules" (admin/modules) and enable:
    • Database search
  • (Save Configuration)

With that enabled, we are able to create a database server.

Creating a Database Server

  • Go to "Configuration = > Search and Metadata => Search API" (admin/config/search/search_api)
  • Click the "Add server" link
  • Server name: Database server
  • [x] Enabled (This will enable the new server after creation)
  • Server description: Search using a normal database search server.
  • Service class: Database service (This is where you identify which type of server backend to use for this server. This setting is required as it specifies how the data will be indexed and searched)
    • Minimum word length (This is exactly like the default search module. You can specify the minimum number of characters a word must have to be indexed. I'm just going to leave this at its default.)
  • (Create server)

We just successfully configured Search API to use our default database as the search server. A database server can be a simple alternative to service classes like Solr, or can be used for smaller sites or less important searches.

I'll demonstrate how the database search works in Video 6, but next we are going to create a Solr server. If you have no intention of using Solr, you can safely skip to Video 6, but because Solr is more powerful, if you have the capability, I'd recommend you give that a look.

So in the next video, I will show you how to install and run Apache Solr, setup Search API Solr Search, and configure it to work with Drupal. Then in Video 5, we'll create a Search API Solr Server that we will use instead of the database server that we created in this video.