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
The Search API server to index. Default: the first enabled Solr server.
Index only this one. Default: every enabled index of the server, one after another.
How many workers run at the same time, each with its own batch. Default: 10.
How many items each worker indexes per round. Default: 200.
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 ostindexes 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 withdrush ossor stop it withdrush osstop. - A run with
--indexis 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
- All commands
- drush ost
- drush oss
- drush osstop
- drush osri
- drush osrb