The interface for Search plugins that use Search indexes, \Drupal\search\Plugin\SearchIndexingInterface, has been changed slightly.
Previously, it had a method called resetIndex()
. This method has been renamed markForReindex()
, and the documentation for this method has been clarified. This method should be marking everything in the plugin's search index for reindexing.
The interface also has a new method called indexClear()
. This method should be deleting everything in the plugin's search index.
For convenience, plugins using the core Search index can use two functions in search.module to implement these methods, passing in the same $type
parameter that they use when they call search_index()
to index their content. For instance, here are the NodeSearch plugin's implementations:
public function indexClear() {
search_index_clear($this->getPluginId());
}
public function markForReindex() {
search_mark_for_reindex($this->getPluginId());
}