Multiple Indexes with Apache Solr
Setup multiple solr core's and then use settings.php to define for each environment as poster above said. 

If you are using ApacheSolr its like: 

$conf['apachesolr_environments']['my_env_id']['url'] = 'http://localhost:8983';


Just make sure your settings.php is not moved from server to server, if it is then use environment variable in apache:

SetEnv ENVIRONMENT development
SetEnv ENVIRONMENT staging
SetEnv ENVIRONMENT production


And use something like this in settings.php 

&lt;?php   
switch ($_SERVER['ENVIRONMENT']) { 
  case 'development': 
    $conf['apachesolr_environments']['my_env_id']['url'] = 'http://localhost:8983';
    break;
  case 'production': 
    $conf['apachesolr_environments']['my_env_id']['url'] = 'http://www.domain.com:8983';
    break;
}   
?&gt;