Skip to main content
Inspiring
September 30, 2008
Question

Parse Search Results

  • September 30, 2008
  • 3 replies
  • 476 views
I have a verity collection and a cf search displaying results. My question is, can I strip the html from the results? The table the results is pulling from is a content table and the field contains html which is blowing out the tables. I have attached my results page. Any thoughts?
This topic has been closed for replies.

3 replies

Inspiring
October 2, 2008
don;t forget to account for the fact that the returned snippet of
content can end in the middle of an html tag, so that the tag will not
be a full tag, i.e. the content may well end with ...<a href="somepa

the best thing to do is strip html tags when you index the collection,
not at output.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Participating Frequently
October 1, 2008
Another comment - if your content is very large and valid XML (XHTML) then you will get better performance using XSLT to convert to plain text. Regex, especially with global replacement "all" get slower as the content gets longer.
Participating Frequently
October 1, 2008
I strip the html/tags when indexing the collection so no need to do anything on output of results. You could do it on result display as well. I use a regex to remove tags. You could probably simplify the regex.

Participating Frequently
October 1, 2008
Actually this will work fine to strip tags: