Group search result by content type I am using apachesolr on my drupal 6 website for search. Now I wanted to use filter results by content type on search page. 
At first I was using a panel page as search page. Here I tried to use the apachesolr filter by content type block. But this didnt work. I tried all other facets available with apachesolr module and all others worked fine. Now I thought maybe filter by content type doesnt work with panels quiet well so i removed the panel page and used the apachesolr default search psge. Still it doesnt work for me. 

Can someone tell me some method for grouping my search results by content type.
I have used same thing in Drupal 7 . Please check if this can help 

Function custom_preprocess_search_results(&amp;$variables) {
  $variables['search_results'] = '';
  $resultTypes = array();

  // Divide results
  foreach ($variables['results'] as $result) {
    $resultTypes[$result['bundle']][] = $result;   
  }

  // Create fieldsets
  foreach ($resultTypes as $resultType =&gt; $resultTypeResults) {
    $value = '';


    foreach ($resultTypeResults as $result) {
      $value .= theme('search_result', array('result' =&gt; $result, 'module' =&gt; $variables['module']));



  $variables['search_results'] .= theme('fieldset', array('element' =&gt; array('#title' =&gt; $resultType, '#children' =&gt; $value));
  }
}