You are here

public function SearchApiAlgoliaBackend::removeIndex in Search API Algolia 3.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php \Drupal\search_api_algolia\Plugin\search_api\backend\SearchApiAlgoliaBackend::removeIndex()
  2. 2.0.x src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php \Drupal\search_api_algolia\Plugin\search_api\backend\SearchApiAlgoliaBackend::removeIndex()

Throws

\Drupal\search_api\SearchApiException

File

src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php, line 222

Class

SearchApiAlgoliaBackend
Class SearchApiAlgoliaBackend.

Namespace

Drupal\search_api_algolia\Plugin\search_api\backend

Code

public function removeIndex($index) {

  // Only delete the index's data if the index isn't read-only.
  if (!is_object($index) || empty($index
    ->get('read_only'))) {
    $this
      ->deleteAllIndexItems($index);
  }
}