# Textile formatting highlighted ferret search results

**URL:** <https://www.ruby-forum.com/t/textile-formatting-highlighted-ferret-search-results/178520>\
**Category:** Rails\
**Created:** [November 5, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/textile-formatting-highlighted-ferret-search-results/178520 "2009-11-05T21:05:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_bell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@steve\_bell](https://www.ruby-forum.com/u/steve_bell)\
**Post date:** [November 5, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/textile-formatting-highlighted-ferret-search-results/178520/1 "2009-11-05T21:05:32Z")

</div>

Hi All,

I am running ferret as my search engine against a table that contains  
two text fields that contain textile formatting using the RedCloth  
gem. I’ve added the fields in to the model as below:

acts\_as\_ferret :fields =\> {  
:question =\> {:store =\> :yes},  
:answer =\> {:store =\> :yes}  
}

and in my search controller i use:

@faqs = Faq.find\_with\_ferret(@query)

In my view I have:

\<% for faq in @faqs %\>

-   
\<%= link\_to faq.highlight(@query, :field =\> :question), faq  
%\>  
  
\<%= faq.highlight(@query, :field =\> :answer) %\>  
  
\<% end %\>

This works, but it displays the information without converting the  
textile format to the correct HTML, eg bold, lists, etc (but the  
search term is highlighted). Any pointers on how to use the ferret  
highlighting and textile together?

Many Thanks,

Steve
