public function SearchApiCommands::serverClear in Search API 8
Clears all search indexes on the given search server.
@command search-api:server-clear
@usage drush search-api:server-clear my_solr_server Clear all search indexes on the search server my_solr_server. @usage drush sapi-sc my_solr_server Alias to clear all search indexes on the search server my_solr_server.
@aliases sapi-sc,search-api-server-clear
Parameters
string $serverId: The machine name of a server.
Throws
\Drupal\search_api\ConsoleException Thrown if the server couldn't be loaded.
\Drupal\search_api\SearchApiException Thrown if one of the affected indexes had an invalid tracker set, or some other internal error occurred.
File
- src/
Commands/ SearchApiCommands.php, line 464
Class
- SearchApiCommands
- Defines Drush commands for the Search API.
Namespace
Drupal\search_api\CommandsCode
public function serverClear($serverId) {
$this->commandHelper
->clearServerCommand($serverId);
}