You are here

protected function IgnoreCase::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/IgnoreCase.php, line 28

Class

IgnoreCase
Makes searches case-insensitive on selected fields.

Namespace

Drupal\search_api\Plugin\search_api\processor

Code

protected function processField(FieldInterface $field) {
  parent::processField($field);
  foreach ($field
    ->getValues() as $value) {
    if ($value instanceof TextValueInterface) {
      $value
        ->setProperty('lowercase');
    }
  }
}