Change the output of the search results I'd like to change the output of the search result page.

For example, I've got 3 different content types: foo, bar, etc. I'd like to group my search results by these content types, so that for every content type the first three or so results are shown followed by a link: "View more results for content-type foo" which will lead you to a page where all results of this specific content type are shown.

I've done some researching and couldn't find a module which does something like this. I guess i have to write my own module, but I don't know where to begin. Do you have any tips for me (whick hooks to implement, etc...)
If you only have 3 types and you don't plan on changing often, the easiest way to do that might be to create views of those three content types and use views_embed_view.

You could potentially override the search results in your theme using search-results.tpl.php. A more complex, and possibly better way would be to write a custom module that implements hook_menu_alter and redirects the default search callback to a custom view in your module.

I have done something like that before and it's not a trivial undertaking (take a look at the apachesolr_search module if you want a complete example).

Something like (untested)...

function mymodule_menu_alter(&amp;$menu) {
  if (isset($menu['search/mymodulesearch/%menu_tail'])) {
    // redirect default search to this module's view
    $menu['search']['page callback'] = 'mymodule_search_view'; 
    // create a menu linkspecifically for this view
    $menu['search/mymodulesearch/%menu_tail']['page callback'] = 'mymodule_search_view';
    $menu['search/mymodulesearch/%menu_tail']['weight'] = -20;
  }
}

function mymodule_search_view() {
  $keys = search_get_keys();

  // do something with views_embed_view here
}