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