You are here

public function SearchApiCommands::setIndexServer in Search API 8

Sets the search server used by a given index.

@command search-api:set-index-server

@usage drush search-api:set-index-server default_node_index my_solr_server Set the default_node_index index to used the my_solr_server server. @usage drush sapi-sis default_node_index my_solr_server Alias to set the default_node_index index to used the my_solr_server server.

@aliases sapi-sis,search-api-set-index-server

Parameters

string $indexId: The machine name of an index.

string $serverId: The machine name of a server.

Throws

\Exception If no index or no server were passed or passed values are invalid.

File

src/Commands/SearchApiCommands.php, line 489

Class

SearchApiCommands
Defines Drush commands for the Search API.

Namespace

Drupal\search_api\Commands

Code

public function setIndexServer($indexId, $serverId) {
  $this->commandHelper
    ->setIndexServerCommand($indexId, $serverId);
}