[thelist] sql server: containstable() with multiple tables?

Chris Blessing webguy at mail.rit.edu
Fri Jan 11 12:24:10 CST 2002


rudy-

Thanks for the info.  Here's my dillema: what if the search term is only in
the title?  I was thinking exactly the same thing, add a where clause... but
if the tipContent field doesn't contain the search term(s), then that row
will be omitted completely won't it?  Thusly the title field would never get
searched...

This would be good, however, for doing a psuedo-boolean on the title and
tipContent fields and further restricting the search results.

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of rudy
> Sent: Friday, January 11, 2002 11:21 AM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] sql server: containstable() with multiple tables?
>
>
> >What I want to do is enable searching on t1.title as well as
> >tipContent.content (currently in the containstable() function).  Should I
> be
> >looking into another join with another containstable() call?  Any help is
> >graciously appreciated. =)
>
> hi chris
>
> never heard of containstable() before, but i can see what it's doing...
>
> if t1.title is an ordinary varchar, try LIKE --
>
>  SELECT t1.id, t1.publishDate, t1.productCode
>       , t1.productName, t1.title, t1.author
>       , K.rank as Rank
>    FROM tips as t1
>  INNER JOIN containstable(tipContent, content
>         , '(""" & searchTerm & """)') as K
>      ON t1.id = K.[key]
>   WHERE t1.title LIKE '%[title search term]%'
>
> looking at what i just wrote, it appears this will work like an AND
> condition
>
> if that's what you want, it might be efficient, too, since the optimizer
> might restrict the t1 rows before attmpting the join
>
>
> rudy
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list