Search API

A contributed module, separate from core's Search module, that indexes chosen entity data on a pluggable server such as the database or Solr.

Learn DrupalDrupal glossary

Search API is a contributed Drupal module that builds search on top of Drupal's entities. It copies the data you choose, such as the title and body of every article, into an index kept by a search engine, and a view then queries that index. Because the engine is a pluggable backend, the same setup works with a database or with Solr.

How Search API works in Drupal 11

Release 8.x-1.42, published on 11 October 2026, declares support for Drupal 10.3 and later, 11 and 12. It is installed with Composer (composer require 'drupal/search_api'). Its administration page is at /admin/config/search/search-api. The documentation describes a few building blocks:

  • A server is a concrete way to store and search data. Its backend decides how; the backend is chosen when the server is created and cannot be changed later.
  • An index is a configuration object attached to a server. It lists the datasources to index, such as content or users, and the fields to keep. Each field has a data type; Fulltext fields can be searched by keyword.
  • Processors prepare indexed data and search queries. Examples are Ignore case, Content access and Entity status.

The module ships one backend, Database search, which the project page calls ready to use. It has a known limit: facets and autocomplete need the database user to hold the CREATE TEMPORARY TABLES permission. Solr, Elasticsearch and others are separate projects.

Items are indexed in batches during cron, or immediately if the index option Index items immediately is set. The form warns that this can hurt performance on larger sites. In Drush, search-api:index indexes items and search-api:status shows how many are left.

Example

The quickest start is the Database Search Defaults submodule, following its README. Install Search API, then enable Database Search Defaults. It creates a server, an index and a search view for nodes. The search page appears at /search/content, and you can adjust the setup under /admin/config/search/search-api. The README advises uninstalling Database Search Defaults again right after installation for performance reasons; the configuration stays.

Common mistakes

  • Assuming results respect access rules. The project page says the module does not enforce access restrictions generically. Use the Content access processor, which adds access checks for nodes and comments, and the Entity status processor, which keeps unpublished entities out of the index.
  • Using a plain Views filter for keywords. The Search API documentation recommends the Fulltext search filter for keywords. Pick it in the view instead of an ordinary text filter.
  • Letting referenced data go stale. Renaming a taxonomy term does not touch the items that mention it unless the index option Track changes in referenced entities is on. The option can slow down saves on large sites.
  • Leaving other search modules running. The Search API documentation advises uninstalling search modules you do not use. Core's Search module, for one, updates the index of its active search pages on every cron run.

For marketing and content teams

What visitors find depends on what the index contains, so tell your developer which content types, fields and languages should be searchable. A new article appears in results only after it is indexed, which can lag behind publishing. If matches in one field, such as the title, should count more, ask for a boost: the documentation defines it as a number that sets how important a field is for fulltext keywords. Review the results page with real queries from your visitors.

Sources

Questions about Search API

The included Database search backend is ready to use. The project page says it is mainly meant for testing and smaller sites, and that larger sites will usually want a more powerful backend such as Solr or Elasticsearch. Solr support comes from the separate Search API Solr project.

Content only appears after it is indexed. Cron indexes items in batches, or you can run drush search-api:index. Check drush search-api:status to see how many items are still waiting. Also check that the index includes the content type and that your view shows that index.

Core's Search module creates search pages from plugins that other modules provide. Search API is a contributed framework with its own servers and indexes. It can search any entity type with any engine, and it works with Views and facets.

Related terms

All Drupal terms from A to Z