ell, that’s because you can’t. For whatever reason.
I can’t modify the variables in search-result.html.twig like so:
$variables[‘result’][‘testvar’] = ‘beeeg test!’;
$variables[‘result’][‘title’] = ‘AMAAAAZING NEW TITLE!!!’;
}
Hmm. Okay.
But I can access testvar like so in the twig file:
{{ result.testvar }}
And if I really want to change the title of my search results, I can do this:
foreach ($vars[‘items’] as &$item) {
$res =& $item[‘value’][‘#result’];
$res[‘title’] = ‘bleaaargh!’ ;
}
}
And now all titles are set to ‘bleaaargh!’ as they should be.


