Chris@0: /** Chris@0: * Implements hook_search_preprocess(). Chris@0: */ Chris@0: function {{ machine_name }}_search_preprocess($text, $langcode = NULL) { Chris@0: // If the language is not set, get it from the language manager. Chris@0: if (!isset($langcode)) { Chris@0: $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); Chris@0: } Chris@0: Chris@0: // If the langcode is set to 'en' then add variations of the word "testing" Chris@0: // which can also be found during English language searches. Chris@0: if ($langcode == 'en') { Chris@0: // Add the alternate verb forms for the word "testing". Chris@0: if ($text == 'we are testing') { Chris@0: $text .= ' test tested'; Chris@0: } Chris@0: } Chris@0: Chris@0: return $text; Chris@0: }