Customize search output I was trying to modify the search results page using a preprocess function:

function arras_preprocess_search_result(&amp;$variables) {

    $type = $variables['result']['node']-&gt;type; 
    $variables['search_results'] = '';
    $nodeTypes = node_type_get_types();
    $resultTypes = array();

      $resultTypes[$type][] = $variables['result'];


    foreach ($resultTypes as $resultType =&gt; $resultTypeResults)
    {
        echo $resultType;
        $value = "";
        // loop through entries
        foreach ($resultTypeResults as $result)
        {
            $value .= theme('search_result', $result,$resultType);
        }

        // add fieldset
        $variables['search_results'] .= theme('fieldset',
            array(
                '#title' =&gt; $nodeTypes[$resultType]-&gt;name,
                '#collapsible' =&gt; TRUE,
                '#collapsed' =&gt; FALSE,
                '#value' =&gt; $value,
            )
        );

    };


}


but I get this error:

( ! ) Fatal error: Unsupported operand types in L:\wamp\www\drupal\includes\theme.inc on line 830


i.e on the line

        $value .= theme('search_result', $result, 'cameras');


What is wrong?
From the Drupal 7 API theme_search_result:


  This function is never used; see the corresponding template file
  instead.


Try overriding the page using search-result.tpl.php