Display thumbnail in search result

function modulename_preprocess_search_result(&$variables) {
  switch($variables['result']['node']->type) {
    case 'nodetype1':
      $n = node_load($variables['result']['node']->nid);
      $n && ($variables['node'] = $n);
      break;
  default:
  break;
}
 
 
search-result.tpl.php
<?php if ($variables['result']['node']->type == 'nodetype1' && isset($variables['result']['node']->field_image[LANGUAGE_NONE][0]['uri'])): ?>
<?php
$image = theme('image_style', array('style_name' => 'thumbnail', 'path' => $variables['result']['node']->field_image[LANGUAGE_NONE][0]['uri']));
?>
Help Share this Article