You are here

public function PluginHelper::createProcessorPlugin in Search API 8

Creates a processor plugin object for this index.

Parameters

\Drupal\search_api\IndexInterface $index: The index for which to create the plugin.

string $plugin_id: The plugin's ID.

array $configuration: (optional) The configuration to set for the plugin.

Return value

\Drupal\search_api\processor\ProcessorInterface The new processor plugin object.

Throws

\Drupal\search_api\SearchApiException Thrown if an unknown $type or $plugin_id is given.

Overrides PluginHelperInterface::createProcessorPlugin

File

src/Utility/PluginHelper.php, line 136

Class

PluginHelper
Provides methods for creating search plugins.

Namespace

Drupal\search_api\Utility

Code

public function createProcessorPlugin(IndexInterface $index, $plugin_id, array $configuration = []) {
  return $this
    ->createIndexPlugin($index, 'processor', $plugin_id, $configuration);
}