public function TestBackend::removeIndex in Search API 8
Removes an index from this server.
This might mean that the index has been deleted, or reassigned to a different server. If you need to distinguish between these cases, inspect $index->getServerId().
If the index wasn't added to the server previously, the method call should be ignored.
Implementations of this method should also check whether $index->isReadOnly() and don't delete any indexed data if it is.
Parameters
\Drupal\search_api\IndexInterface|string $index: Either an object representing the index to remove, or its ID (if the index was completely deleted).
Throws
\Drupal\search_api\SearchApiException Thrown if an error occurred while removing the index.
Overrides BackendPluginBase::removeIndex
File
- tests/
search_api_test/ src/ Plugin/ search_api/ backend/ TestBackend.php, line 175
Class
- TestBackend
- Provides a dummy backend for testing purposes.
Namespace
Drupal\search_api_test\Plugin\search_api\backendCode
public function removeIndex($index) {
if ($override = $this
->getMethodOverride(__FUNCTION__)) {
call_user_func($override, $this, $index);
return;
}
$this
->checkError(__FUNCTION__);
}