You are here

public function SearchApiCommands::status in Search API 8

Shows the status of one or all search indexes.

@command search-api:status

@usage drush search-api:status Show the status of all search indexes. @usage drush sapi-s Alias to show the status of all search indexes. @usage drush sapi-s node_index Show the status of the search index with the ID node_index.

@field-labels id: ID name: Name complete: % Complete indexed: Indexed total: Total

@aliases sapi-s,search-api-status

Parameters

string|null $indexId: (optional) A search index ID, or NULL to show the status of all indexes.

Return value

\Consolidation\OutputFormatters\StructuredData\RowsOfFields The table rows.

Throws

\Drupal\search_api\SearchApiException Thrown if one of the affected indexes had an invalid tracker set.

File

src/Commands/SearchApiCommands.php, line 201

Class

SearchApiCommands
Defines Drush commands for the Search API.

Namespace

Drupal\search_api\Commands

Code

public function status($indexId = NULL) {
  $rows = $this->commandHelper
    ->indexStatusCommand([
    $indexId,
  ]);
  return new RowsOfFields($rows);
}