Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Searching nvarchar column for the best articles

Author  Topic 

redbrad0
Posting Yak Master

176 Posts

Posted - 2005-05-06 : 23:19:56
I have a table that has 2 million records in it that I need to bring out the most relevant information out of the database in ranking order of the most relevant information.

Lets say I have this phrase...
running under water in the rain at high speeds

My current SQL String looks like this....

SELECT TOP 10 Data.Data_ID, Data.Data_FeedID, Data.Data_Title, Data.Data_Link, Data.Data_Desc, Data.Data_DateCreated, Data.Data_Desc_Checksum,
WEIGHT.RANK AS RSSFeedRanking
FROM RSS_Feeds_Data Data INNER JOIN
CONTAINSTABLE(RSS_Feeds_Data, *,
'ISABOUT ("running under water in the rain at high speeds" weight (1.0), "running under water in the rain at high" NEAR "speeds"
weight (0.9), "running under water in the rain at" NEAR "high speeds" weight (0.9), "running under water in the rain" NEAR "at
high speeds" weight (0.9), "running under water in the" NEAR "rain at high speeds" weight (0.9), "running under water in" NEAR
"the rain at high speeds" weight (0.9), "running under water" NEAR "in the rain at high speeds" weight (0.9), "running under"
NEAR "water in the rain at high speeds" weight (0.9), "running" NEAR "under water in the rain at high speeds" weight (0.9),
"running under water in the" weight (0.5), "under water in the rain" weight (0.5), "running under water in" weight (0.4), "under
water in the" weight (0.4), "water in the rain" weight (0.4), "running under water" weight (0.3), "under water in" weight (0.3),
"water in the" weight (0.3), "in the rain" weight (0.3), "running under" weight (0.2), "under water" weight (0.2), "water in"
weight (0.2), "in the" weight (0.2), "the rain" weight (0.2))')
WEIGHT ON Data.Data_ID = WEIGHT.[KEY]
ORDER BY WEIGHT.RANK DESC


For the most part it does pull up relevant information but I think it can be improved on. In my opinion the noise words should maybe be removed and not looking for the phrase but looking for articles that have all the major words in it would have a ranking of 1.0 and each time it removes a word then ranking goes down lets say 0.1 so the next one would have a ranking of 0.9.

Anyone have any ideas?

Quality NT Web Hosting & Design
   

- Advertisement -