iBasically I want to display full nodes when doing a search. no highlighting of keywords, or anything. just list the full nodes as if it were a view. I looked at the code on how to show teasers in search results

Which is this:

function foundation_search_item($item, $type)
{
    if (module_hook($type, 'search_item'))
    {
        $output = module_invoke($type, 'search_item', $item);
    }
    else
    {
        $info = array();
        if ($item['type']) $info[] = $item['type'];
        if ($item['user']) $info[] = $item['user'];
        if ($item['date']) $info[] = format_date($item['date'], 'small');
        if (is_array($item['extra'])) $info = array_merge($info, $item['extra']);

        $output  = '<div class="search-result">';
        $output .= '<dt class="title">';
        $output .= '<a href="/'.check_url($item['link']).'">';
        $output .= check_plain($item['title']).'</a>';
        $output .= '</dt><dd>';
        $output .= '<p class="search-info">'.implode(' - ', $info).'</p>';
        $output .= '<p>'.$item['snippet'].'</p>';
        $output .= '</dd>';
        $output .= '</div>';
    }
    return $output;
}

I can almost see how this is laid out in my search results, but am not sure of where to go to get the full node to show up. I also don't know how this would affect the fact that I used templates for a number of content types. Anyone have nay idea how to work this out? Was kinda hoping I could just replace $item['snippet'] with $item['full'] or something, but I know it's not that simple.

Comments

solidad’s picture

bumping...been trying to list the full node or even the teaser and, I can't for the life of me get either to actually show up. what is in the code above isn't actually the teaser, but a custom output...as you can see by the code...so I can't do things like display graphics, because the search results use this snippet thing, which is pretty useless to me because it makes the search results look very strange.

The reason I want full nodes or teasers displayed is because my searchable content has only one link but the rest is images. Tried to maybe figure out how categories or views list full nodes to maybe give me a clue as to how to accomplish what I want, but it just escapes me. I don't have to have the full answer put in front of me, but I really just want some help, or tips on how to do this.

Stephan_M’s picture

I'd like to have full nodes as search results instead of the "snippet", too. Anybody got any advice?

cnewtonne’s picture

I used 'views' to create a search result view. The body field has 2 options to show either full or teaser style.

podsnap’s picture

How do you use View to display search results?

I've never used the View module and it's all a bit complex.