• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Parse Search Results

Explorer ,
Sep 30, 2008 Sep 30, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

437

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2008 Oct 01, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2008 Oct 01, 2008

Copy link to clipboard

Copied

Actually this will work fine to strip tags:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 01, 2008 Oct 01, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2008 Oct 01, 2008

Copy link to clipboard

Copied

LATEST
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/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation