You are here

public function TestBackend::updateIndex in Search API 8

Notifies the server that an index attached to it has been changed.

If any user action is necessary as a result of this, the method should set a message to notify the user.

Parameters

\Drupal\search_api\IndexInterface $index: The updated index.

Throws

\Drupal\search_api\SearchApiException Thrown if an error occurred while reacting to the change.

Overrides BackendPluginBase::updateIndex

File

tests/search_api_test/src/Plugin/search_api/backend/TestBackend.php, line 163

Class

TestBackend
Provides a dummy backend for testing purposes.

Namespace

Drupal\search_api_test\Plugin\search_api\backend

Code

public function updateIndex(IndexInterface $index) {
  if ($override = $this
    ->getMethodOverride(__FUNCTION__)) {
    call_user_func($override, $this, $index);
    return;
  }
  $this
    ->checkError(__FUNCTION__);
  $index
    ->reindex();
}