Multi-Server Setup
If you have multiple Solr servers with different indexes assigned to each, always specify
the --server option to target the correct one.
# List all servers and their indexes
drush search-api:server-list
# Rebuild and index for production server
drush osrb --server=production_solr
drush ost --server=production_solr --workers=8 --batch=500 --background
# Rebuild and index for staging server
drush osrb --server=staging_solr
drush ost --server=staging_solr --workers=4 --batch=200 --background
Understanding Servers vs Indexes
Server
A Search API server is a connection configuration to a Solr instance. It defines the host, port, authentication, and other connection details.
Index
A Search API index defines what content to index and which fields to include. Each index is assigned to exactly one server.
Common Setup
| Server | Indexes | Purpose |
|---|---|---|
production_solr |
main_content, products | Live site search |
staging_solr |
main_content_stg, products_stg | Testing before deployment |
Server-Specific Commands
View Server Configuration
# List all servers
drush search-api:server-list
# Check specific server status
drush search-api:server-status production_solr
Rebuild All Indexes on a Server
drush osrb --server=production_solr
Index All on a Server
drush ost --server=production_solr --workers=8 --batch=500 --background
Check Status for a Server
drush oss --server=production_solr
⚠️ Default Server
If you don't specify --server, the indexer auto-detects the first
available Solr server. This may not be what you want in a multi-server setup.
Always specify the server explicitly.
Parallel Server Indexing
You can index multiple servers simultaneously by running separate background processes:
# Terminal 1: Production server
drush ost --server=production_solr --workers=4 --batch=500 --background
# Terminal 2: Staging server (start after production begins)
# Note: Only one background process at a time per Drupal installation
# Run staging in foreground or on a different machine
💡 One Background Process
The turbo indexer allows only one background process at a time to prevent resource
conflicts. To index multiple servers simultaneously, run one in background and
one in foreground, or use separate Drupal installations.