drush ost - Start Parallel Solr Indexing in Drupal

opensolr:turbo, the indexing command

drush ost

drush ost (full name opensolr:turbo) indexes every item that waits in the Search API tracker, with parallel workers. By default it starts in the background and gives you your terminal back at once.

drush ost [--server=ID] [--index=ID] [--workers=N] [--batch=N] [--no-background]

Options

--server

The Search API server to index. Default: the first enabled Solr server.

--index

Index only this one. Default: every enabled index of the server, one after another.

--workers

How many workers run at the same time, each with its own batch. Default: 10.

--batch

How many items each worker indexes per round. Default: 200.

--no-background

Run in your terminal instead of in the background. Default: off, so runs go to the background.

What you see

Starting turbo indexer in background: my_solr_server
Background process started (PID: 12345)
Log file: /tmp/opensolr_turbo_my_solr_server.log
Check status: drush oss
Stop all: drush osstop

From here, follow it with drush oss or read the log: Background mode.

Examples

# Index one server with the defaults
drush ost --server=my_solr_server

# One index, fewer workers, bigger batches
drush ost --index=content_index --workers=4 --batch=500

# Watch it in the terminal; Ctrl+C stops it
drush ost --server=my_solr_server --no-background

Good to know

  • drush ost indexes only items marked as waiting. To redo every item, run drush osri first.
  • While a background run for the same server and index is going, a second one refuses to start: Turbo indexer already running for '...' (PID: ...). Check it with drush oss or stop it with drush osstop.
  • A run with --index is a separate session from a run without it, so both can run at once: Several servers and indexes.
  • It needs the PHP extension pcntl and stops at once without it: pcntl extension required.

Commands