public function FieldsProcessorPluginBase::preprocessIndexItems in Search API 8
Preprocesses search items for indexing.
Parameters
\Drupal\search_api\Item\ItemInterface[] $items: An array of items to be preprocessed for indexing.
Overrides ProcessorPluginBase::preprocessIndexItems
1 method overrides FieldsProcessorPluginBase::preprocessIndexItems()
- Stemmer::preprocessIndexItems in src/
Plugin/ search_api/ processor/ Stemmer.php - Preprocesses search items for indexing.
File
- src/
Processor/ FieldsProcessorPluginBase.php, line 289
Class
- FieldsProcessorPluginBase
- Provides a base class for processors that work on individual fields.
Namespace
Drupal\search_api\ProcessorCode
public function preprocessIndexItems(array $items) {
// Annoyingly, this doc comment is needed for PHPStorm. See
// http://youtrack.jetbrains.com/issue/WI-23586
/** @var \Drupal\search_api\Item\ItemInterface $item */
foreach ($items as $item) {
foreach ($item
->getFields() as $name => $field) {
if ($this
->testField($name, $field)) {
$this
->processField($field);
}
}
}
}