This seems to be a bit overcomplex, unless I'm misreading your code. Why not
just use Regex?
<!--- This would be the keywords searched for --->
<CFSET Searched = "ray camden">
<CFSET ModSearched = "(" & Replace(Searched," ","|","ALL") & ")">
<!--- This would be the results from the DB, normally a query --->
<CFSET Results = "This is a ray test camden foo.">
<CFOUTPUT>
#REReplace(Results,"#ModSearched#","<SPAN
CLASS=""highlight"">\1</SPAN>","ALL")#
</CFOUTPUT>
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : [EMAIL PROTECTED]
ICQ UIN : 3679482
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: Michael Lugassy [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 12:03 PM
> To: CF-Talk
> Subject: great Search Results snippest!
>
>
> Hi,
> I just constructed a snippest that will highlight each word on
> the results page (very much like MSDN
> results page). SUPPORT MULTIPLE keywords!
>
> I just did it in a couple of minutes and HAD TO GIVE IT TO YA to
> look and use.
>
> I will post the optimized version soon...
>
> *class="highlight" reffers to the design you want to highlight
> in my case:
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists