protected function Tokenizer::processField in Search API 8
Processes a single field's value.
Calls process() either for each value, or each token, depending on the type. Also takes care of extracting list values and of fusing returned tokens back into a one-dimensional array.
Parameters
\Drupal\search_api\Item\FieldInterface $field: The field to process.
Overrides FieldsProcessorPluginBase::processField
File
- src/
Plugin/ search_api/ processor/ Tokenizer.php, line 137
Class
- Tokenizer
- Splits text into individual words for searching.
Namespace
Drupal\search_api\Plugin\search_api\processorCode
protected function processField(FieldInterface $field) {
parent::processField($field);
foreach ($field
->getValues() as $value) {
if ($value instanceof TextValueInterface) {
$value
->setProperty('tokenized');
}
}
}