Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Search API Fast

Security covered Under active development 364 sites

Part of the Search ecosystem · 126 projects

This module provides Drush commands to speed up Search API indexing by using multiple CPU cores. It leverages a multi-process approach to handle queues simultaneously, significantly improving indexing speed for large sites. This functionality requires Drush and a Unix/Linux environment.

Search API Fast dramatically speeds up (re)indexing of large Search API indexes by spreading the work across all of your server's CPU cores.

Standard Search API indexing runs in a single process: one batch at a time, on one core. For a site with hundreds of thousands of items, or after a schema change that needs a full reindex, that can mean hours of waiting. Search API Fast shards the items across parallel worker processes, so with 8 workers on an 8-core machine indexing runs up to roughly 8× faster. The real gain depends on your backend and I/O.

Try 3.x: a complete rewrite

3.x is in beta and ready for testing. It keeps the proven design of 2.x (parallel workers backed by database queues), but every part is rebuilt for Drupal 11 and 12 with dependency injection, hardened process handling and full test coverage. It is already running in production. Please try it on your site and tell us how it goes in the issue queue: every report helps us reach a stable release.

composer require 'drupal/search_api_fast:^3@beta'
drush updatedb
drush config:export

What's new in 3.x

  • Works with any Search API backend: Solr, database, OpenSearch and others. Search API Solr is no longer required.
  • Runs in the background by default. drush sapi-fast returns immediately, so it fits deploy and CI pipelines. Add --progress to watch a live progress bar with rate and ETA.
  • Indexes all enabled indexes in order, with --exclude to skip a slow or rate-limited index.
  • Web dashboard per index: start, reindex, clear-and-index and stop, with live progress, indexing rate, ETA and host load.
  • Reliable stop from the dashboard or with drush sapi-fast-stop.
  • Robust runs: items that fail (for example on database deadlocks) are retried, and a run that stalls or ends incomplete is reported and cleaned up.
  • Ready for Drush 15: on Drupal 11.4 and later the commands also run with Drupal's own dr tool (vendor/bin/dr sapi-fast), which is what Drush 15 uses. Drush 13 keeps working, with the same commands and options.
  • Zero-configuration worker setup: workers start with the project's vendor/bin/dr on Drupal 11.4 and later, or otherwise with the project's own Drush, found through Composer. A global Drush Launcher and the Drush 15 drush stub are skipped.
  • Hardened process handling: workers are started with the Symfony Process component (no shell strings) and tracked by PID.

Requirements

  • Drupal 11.3 or higher (including Drupal 12) and PHP 8.3 or higher
  • Search API
  • A command line tool to run the workers: Drupal's own dr (Drupal 11.4 and later, with or without Drush 15), or Drush 12 or 13
  • A server where PHP can start processes (proc_open() enabled), such as VPS, dedicated or container hosting. ext-posix and setsid are recommended.

Usage

drush sapi-fast                         # all enabled indexes, in the background
drush sapi-fast my_index                # one index
drush sapi-fast my_index reindex        # mark all items for reindexing first
drush sapi-fast my_index clear          # clear the index first
drush sapi-fast --exclude=slow_index    # skip an index
drush sapi-fast --progress              # foreground, with a live progress bar
drush sapi-fast-stop                    # stop everything

On Drupal 11.4 and later you can run the same commands with vendor/bin/dr instead of drush, for example vendor/bin/dr sapi-fast --progress. With Drush 15 that is the only way.

Or open the Fast indexing tab on an index (Configuration » Search and metadata » Search API).

Configuration

All settings are optional. Set them at admin/config/search/search-api-fast, or in settings.php, for example to use a different number of workers per environment:

// 2.x and 3.x
$config['search_api_fast.performance']['index_workers'] = 8;
$config['search_api_fast.performance']['worker_batch_size'] = 100;
$config['search_api_fast.performance']['max_batches_worker_respawn'] = 4;

// 3.x only
$config['search_api_fast.performance']['poll_interval_ms'] = 250;
$config['search_api_fast.performance']['stall_timeout_seconds'] = 300;
$config['search_api_fast.performance']['log_retention_hours'] = 24;
  • index_workers: number of parallel workers. Do not set this higher than the number of available CPU cores.
  • worker_batch_size: items each worker indexes per batch.
  • max_batches_worker_respawn: batches a worker processes before it restarts itself to release memory.
  • poll_interval_ms (3.x): how often progress is polled.
  • stall_timeout_seconds (3.x): stop a run that makes no progress for this long.
  • log_retention_hours (3.x): worker log files are removed by cron after this many hours.

Executable path. 3.x finds the tool that runs the workers automatically (dr on Drupal 11.4 and later, otherwise Drush), so you normally leave this empty. To set it anyway, enter an absolute path as the Command line executable path on the settings page, or per environment in settings.php. A path whose file name is dr is run as dr, anything else as Drush:

$settings['search_api_fast_drush_path'] = '/path/to/vendor/bin/dr';

A configured drush that no longer runs, such as the Drush 15 stub, is skipped with a warning in the log. In 2.x, set $config['search_api_fast.performance']['drush'] instead. Its default is drush, looked up in PATH.

Upgrading from 2.x

Command names, aliases and your existing settings are kept. After composer require, run drush updatedb and export your configuration. The main differences: drush sapi-fast now processes all enabled indexes instead of one, and foreground monitoring is opt-in with --progress. Read UPGRADING.md before upgrading.

2.x (stable, maintenance only)

2.x supports Drupal 9.5 to 11 and receives bug fixes only; new development happens in 3.x. It requires Drush, a Unix/Linux system and Search API Solr. For its settings, see Configuration above.

drush sapi-fast [index-name]            # index
drush sapi-fast [index-name] reindex    # mark all items for reindexing first
drush sapi-fast [index-name] clear      # clear the index first
Drupal 9–11

Ask your assistant about Search API Fast

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
10
Tracked since
May 2023
Latest release
1 week ago
Releases (12 mo)
6 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
3.0.0-beta3 Pre-release 11 PHP >=8.3 Nov 17, 2026
3.0.0-beta2 Pre-release 11 PHP >=8.3 Nov 3, 2026
3.0.0-beta1 Pre-release 11 PHP >=8.3 Nov 3, 2026
3.0.0-alpha2 Pre-release 11 PHP >=8.3 Sep 26, 2026
3.0.0-alpha1 Pre-release 11 Jun 2, 2026
3.0.x-dev Dev 11 May 29, 2026
2.3.0 Stable 9–11 Aug 30, 2024
2.x-dev Dev 9–11 Jul 3, 2023
2.2.1 Stable 8–10 May 26, 2023
2.2.0 Stable 8–10 May 26, 2023