You are here

public function SearchApiCommands::resetTracker in Search API 8

Marks one or all indexes for reindexing without deleting existing data.

@command search-api:reset-tracker

@option entity-types List of entity type ids to reset tracker for.

@usage drush search-api:reset-tracker Schedule all search indexes for reindexing. @usage drush sapi-r Alias to schedule all search indexes for reindexing . @usage drush sapi-r node_index Schedule the search index with the ID node_index for reindexing.

@aliases search-api-mark-all,search-api-reindex,sapi-r,search-api-reset-tracker

Parameters

string $indexId: The machine name of an index. Optional. If missed, will schedule all search indexes for reindexing.

array $options: An array of options.

Throws

\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 277

Class

SearchApiCommands
Defines Drush commands for the Search API.

Namespace

Drupal\search_api\Commands

Code

public function resetTracker($indexId = NULL, array $options = [
  'entity-types' => [],
]) {
  $this->commandHelper
    ->resetTrackerCommand([
    $indexId,
  ], $options['entity-types']);
}