Full Text Search: percentage match

I need to add a percentage "perfect match" for my search-action, for instance 50% perfect match if only one of the 2 searchexpressions were found. Full Text Search seems to perfect for the search-action, but how do I add this percentage to my select?

This may have a simple solution but I do not seem to be able to find it. Any help is greatly appreciated.

Vicky

[400 byte] By [VickyP] at [2007-12-24]
# 1

You need to put each search expression in a different containstable() and aggregate over the union of the containstable results.

FengTian-MSFTSQLFullText at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 2
Thanks for the reply but can you give me a bit more information? How can this help to generate a percentage match for a search?
VickyP at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 3

Say you want percentage match on "foo" and "bar".

select foo.[key],(IsNull(foo.fooExist, 0)+IsNull(bar.barExist,0))/ 2.0

from

(

(select [key], 1 as fooExist fromcontainstable(t1,*,'hello')) foo

fullouterjoin

(select [key], 1 as barExist fromcontainstable(t1,*,'bar')) bar

on foo.[key] = bar.[key]

)

FengTian-MSFT at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 4

Thanks for your example! I'll give it a try.

VickyP at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 5

hey
Can u guide me if possible..
I'm able to create Full text indexing catalogs, populate them etc.. when i login directly from the server using Sql Server Enterprise manager but when I try to use the same login (db owner) remotely from some other machine using SQL Server Enterprise Manager, I see disabled Full-text Service and all full-text features disabled. So how can i populate or create catalogs remotely using sql server enterprise manager.
Thanks

Sattva at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Database Engine...
# 6
Sattva,
See my reply in the http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=816452&SiteID=1&mode=1 thread..

Thanks,
John
SQL Full Text Search Blog
http://jtkane.spaces.live.com/

JohnKane at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Database Engine...

SQL Server

Site Classified