Are you using $browse.class_array? It indeed is an array with content class identifiers. And the content/search fetch function expects an ID or an array of ID's.
You can loop over the $browse.class_array, fetch the class and build an array with class id's:
{def $classIDList=array()}
{foreach $browse.class_array as $classIdentifier}
{def $class=fetch('content', 'class', hash( 'class_id', $classIdentifier ))}
{set $classIDList=$classIDList|append($class.id)}
{undef $class}
{/foreach}
{* place search code here *}
{undef $classIDList}
Can you share your template when it's finished? That would be a nice contribution ;-)
Do you want to replace the default one with yours from inside an extension?
Or do you want to override it when certain conditions are met? See http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_override_conditions content/browse.tpl