Jochem,

Thanks for the code, there are still problems though:

1. I need the "summary" to be no more then 2-3 sentences,
currently there is no upper limit for the output summary,
as your code stopps when he finds all words.

2. I'm receiving a Bad regular expression error on this line:
temp = REReplaceNoCase(Product_description,expression,"\1")
Do you know what can cause this?

Thanks for helping!


>
> Try the code below. Performance shouldn't be a problem, getting 2
> keywords + their context out of a 20000 bytes string takes about 15 ms
> on a Duron 800.
>
> <cfset words = 3> <!--- # words in context --->
> <cfoutput quey="...">
>    <p>
>    <a href="">#Product_title#</a><br>
>    <cfloop list="#query_filtered#" delimiters="|" index="i">
>      <cfset expression =
>
"^.*(([^[:space:]]*[[:space:]]+){#words#}(#i#)([[:space:]]+[^[:space:]]*){#w
ords#}).*">
>      <cfset temp = REReplaceNoCase(product_description,expression,"\1")>
>      <cfset temp = Replace(temp,i,"<b>" & i & "</b>","All")>
>      ...#temp#...
>    </cfloop>
>    </p>
> </cfoutput>
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to