Using the score column to relevance-rank search results

Relevance ranking is the ability of the Enhanced Full-Text Search engine to assign the score parameter a value that indicates how well a document satisfies the query. The score calculation depends on the search operator used in the query. See “Using the Verity operators”. The closer the document satisfies the query, the higher the score value is for that document.

For example, if you search for documents that contain the word “rain,” a document with 12 occurrences of “rain” receives a higher score value than a document with 6 occurrences of “rain.”

If you set score to a high value (such as 90) in your query, you limit the result set to documents that have a score value greater than that number.

NoteVerity uses decimals for score values; Sybase uses whole numbers. For example, if Verity reports a score value of .85, Sybase reports the same value as 85.

For example, the following query searches for documents that contain the word “raconteur” or “Paris,” or both, and that have a score of 90 or greater:

select t1.score, t2.copy
from i_blurbs t1, blurbs t2
where t1.id=t2.id and t1.score > 90
and t1.index_any = "<accrue>(raconteur, Paris)"
score     copy 
-----    ------------------------------------------------------------
(0 rows affected)

The query does not find any documents that contain the word “raconteur” or “Paris” and that have a score greater than 90. However, if the score value in the query is lowered to 39, you find that one document in the blurbs table mentions the word “raconteur” or “Paris:”

select t1.score, t2.copy
from i_blurbs t1, blurbs t2
where t1.id=t2.id and t1.score > 39
and t1.index_any = "<accrue>(raconteur, Paris)"
score     copy 
-----    --------------------------------------------------------
40    A chef’s chef and a raconteur’s raconteur, Reginald
    Blotchet-Halls calls Londonhis second home. "Th’ palace
    . . .