RANK column indicates how well a row matched the selection criteria.
SELECT *
FROM CONTAINSTABLE ( someTable, *, 'surf OR life' ) AS ct
INNER JOIN someTable ON
ct.[KEY] = someTable.i
Assuming we run the above query, I would expect that the two rows returned by a query ( one containing string life
and other containing string surf
) will be ranked the same, but they aren’t!
a) For that reason, isn’t RANK column helpful only for comparing RANK values for rows containing the same word/phrase? Namely, if the above query returned two rows, where row A
contains 5 occurrences of a word surf
, while row B
contains 6 occurrences of a word life
, then we can’t really rely on RANK values to tell us which ro开发者_开发知识库w was a better match ( since row B could be ranked lower even though it matched selection criteria better )?
b) I assume that two rows, both containing one occurrence of word surf
will always have equal RANK values, regardless of whether one of the rows contains 1000 characters in a string, while other only 10 characters?
thanx
Check 2008 Books Online How Search Query Results Are Ranked for details on ranking and why that happens (see the detailed formula).
You could do more tests of your data:
'life OR surf'
Check out the CONTAINS syntax for more ideas, or weight those you care about.
Your answers:
a) the RANK formula is much more complex than you suggest.
b) the RANK formula suggests otherwise.
精彩评论