Different layout on search page depending on category post

You can use:

if ( in_category(4) ) 

in order to add different HTML for a post in category 4. This has to be in within the loop for it to work.