This question already has an answer here:

I have some fields (say, pictures or whatever) in my custom content-type and I want them to appear in search results. How do I do that?

I know how to edit template files such as search-result.tpl.php provided by the search module. In this page, there is a single variable called $snippet which contains search result but as a rendered HTML output. How do I modify it/show my custom fields in search results?

I would like to have full control to contents of the files, rather than just rendered HTML for them. My Search display page requires customization a lot, so without getting each field individually, I won't be able to produce desired output.

marked as duplicate by Felix Eve, Krishna Mohan, Scott Joudry, Free Radical, tenken Jun 5 '15 at 15:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Try the Display Suite module. There you can change the appereance of a content type in different view modes. One of these view modes is for example the search result.


This page shows the info you need to customize the indexing of your fields.

As for the output, this one should lead you on the correct path.

  • How does hook_search_preprocess take me to correct path?! – Shafiul Apr 3 '12 at 6:46
  • I mean : the path to follow to learn how to customize your result page. – Countzero Apr 3 '12 at 6:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.