Re: modifying results

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jeff Cochran (jeff.nospam_at_zina.com)
Date: 07/10/04


Date: Sat, 10 Jul 2004 20:37:23 GMT

On Sat, 10 Jul 2004 16:13:13 -0400, "shank" <shank@tampabay.rr.com>
wrote:

>The SQL newsgroup sent me here....
>Using the following query I get my desired results. However, in the
>resulting recordset, how can I show for example 10 words before and 10 words
>after the keyword or phrase that was searched upon? If I get 20 resulting
>records I think it would be easier for the user to decide which they want to
>view. Google does this.
>thanks
>
>DECLARE @SearchString varchar(100)
>SET @SearchString = ' "stress" '
>SELECT KEY_TBL.RANK, Title, Body
>FROM Articles INNER JOIN
> FREETEXTTABLE(Articles,*, @SearchString) AS KEY_TBL
> ON Articles.ID = KEY_TBL.[KEY]
>ORDER BY Rank DESC

You'll need to retrieve the article body, parse it to find the word
searched for, then parse out the ten words before and after that one
to formulate the display. There are any number of utilities that
already do this if you're looking for a canned package, but there
isn't (that I've seen) a way to retrieve only that group of words.

Naturally, you'll have difficulty with the article that has the line:

"Stress can cause distress in the stressed individual and his
mistress, seamstress and any distressed person."

:)

Jeff



Relevant Pages

  • Re: C code for Internet Access
    ... > Can someone provide me with a simple prototype for internet access ... That will retrieve the URL and store it in the local file as given ... you can parse it locally using some program you write. ...
    (comp.lang.c)
  • Re: ASP.net multithreading?
    ... I want to allow the user to select which sites to retrieve and parse. ... > Am I able to use ASP.net to multithread retrieve webpages? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ASP.net multithreading?
    ... I want to allow the user to select which sites to retrieve and parse. ... > Am I able to use ASP.net to multithread retrieve webpages? ...
    (microsoft.public.dotnet.languages.vc)
  • Re: ASP.net multithreading?
    ... I want to allow the user to select which sites to retrieve and parse. ... > Am I able to use ASP.net to multithread retrieve webpages? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.net multithreading?
    ... I want to allow the user to select which sites to retrieve and parse. ... > Am I able to use ASP.net to multithread retrieve webpages? ...
    (microsoft.public.dotnet.languages.csharp)