Remove dots ( ... ) from default search results descriptions ( snippet )
You use incorrect variable name.

Take a look for the search-result.html.twig template.
We have a snippet template variable.

Your code should looks like:

function theme_preprocess_search_result(&amp;$variables) {
  $variables['snippet']['#markup'] = str_replace('…', '', $variables['snippet']['#markup']);
}


Pay attention to …, this is a special symbol, not ... (three dots).