[PR] Set a main class in search results, also a default

Avoid a PHP notice by ensuring `$main_class` is always set.