You are here

public function SnowballStemmer::preprocessIndexItems in Snowball Stemmer 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/search_api/processor/SnowballStemmer.php \Drupal\snowball_stemmer\Plugin\search_api\processor\SnowballStemmer::preprocessIndexItems()

File

src/Plugin/search_api/processor/SnowballStemmer.php, line 106

Class

SnowballStemmer
Stems search terms.

Namespace

Drupal\snowball_stemmer\Plugin\search_api\processor

Code

public function preprocessIndexItems(array $items) {
  foreach ($items as $item) {
    if ($this
      ->getStemmer()
      ->setLanguage($item
      ->getLanguage())) {
      foreach ($item
        ->getFields() as $name => $field) {
        if ($this
          ->testField($name, $field)) {
          $this
            ->processField($field);
        }
      }
    }
  }
}