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 2005 Forums
 Transact-SQL (2005)
 CONTAINSTABLE and rankings

Author  Topic 

pm81
Starting Member

1 Post

Posted - 2009-12-02 : 12:36:04
Hi all,

I am receiving some strange rankings from a fairly simple CONTAINSTABLE statement and was wondering if anyone could shed some light on it for me.

Where the variable @FoodName = '
ISABOUT(
"brown bread" weight(0.9),
"brown" NEAR "bread" weight(0.1),
"brown*" NEAR "bread*" weight(0.1)
)'

, the statement is as follows:

FROM [Food] f
INNER JOIN CONTAINSTABLE (Food, [Name], @FoodName) AS tmp ON f.foodID = tmp.[Key]


This returns me:

Bread, brown , small loaf RANK = 225
Bread roll, brown, soft RANK = 225
Brown bread , Danish style, light RANK = 70

Should 'Brown bread , Danish style, light' be ranked higher as it contains the phrase 'brown bread'?

I have tried changing the [name] field of the RANK=70 row to be the same as the top row but that results in...

Bread, brown , small loaf RANK = 225
Bread roll, brown, soft RANK = 225
Bread, brown , small loaf RANK = 70

Am I missing something simple?

Thanks,

pm

   

- Advertisement -