Developer documentation

This section contains documentation for developers, explaining the Search API's basic architecture and giving examples of how certain extensions for it can be developed.

It is expected that you are already familiar with the Search API from a site builder's perspective at this point. Otherwise, you should read up on it now, especially the Glossary.

Also, most extensible sub-systems of the Search API use Drupal 8's new Plugin API, so you should be familiar with that, too.

Available plugin types

Lists plugin types provided by the Search API

Add fields to a search index programmatically

Sample code to add fields to a search index.

Create custom fields using a custom processor

Using a custom processor to add new available fields for a Search API index

Defining new backend features

How to define (or implement) new backend features.

Executing a search in code

Simple instruction for executing a search programmatically

Providing a new datasource plugin

How to make new types of data available for searching/indexing by providing a custom datasource plugin

Adding an entity reference via a processor

How to use a processor to make whole entities (with all their properties) available for indexing

Search by specific date programmatically

Custom code for making a search view date filter filter on a single day

Guide maintainers

drunken monkey's picture