You are here

public function SearchApiSolrBackend::updateIndex in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::updateIndex()
  2. 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::updateIndex()
  3. 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::updateIndex()

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

src/Plugin/search_api/backend/SearchApiSolrBackend.php, line 666

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

public function updateIndex(IndexInterface $index) {
  if ($this
    ->indexFieldsUpdated($index)) {
    $index
      ->reindex();
  }
}