You are here

protected function SearchTextProcessor::invokePreprocess in Drupal 9

Invokes hook_search_preprocess() to simplify text.

Parameters

string $text: Text to preprocess, passed by reference and altered in place.

string|null $langcode: Language code for the language of $text, if known.

1 call to SearchTextProcessor::invokePreprocess()
SearchTextProcessor::analyze in core/modules/search/src/SearchTextProcessor.php
Runs the text through character analyzers in preparation for indexing.

File

core/modules/search/src/SearchTextProcessor.php, line 119

Class

SearchTextProcessor
Processes search text for indexing.

Namespace

Drupal\search

Code

protected function invokePreprocess(string &$text, ?string $langcode = NULL) : void {
  foreach ($this->moduleHandler
    ->getImplementations('search_preprocess') as $module) {
    $text = $this->moduleHandler
      ->invoke($module, 'search_preprocess', [
      $text,
      $langcode,
    ]);
  }
}