Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
APPLIES TO:
NoSQL
This function returns a BM25 score value that can only be used in an ORDER BY RANK
clause to sort results from highest relevancy to lowest relevancy.
FullTextScore(<property_path>, <array_expr>)
Description | |
---|---|
property_path |
The property path to search. |
array_expr |
A nonempty array of string literals. |
Returns a BM25 scoring.
This is a simple example showing how to use FullTextScore
with ORDER BY RANK
to sort from highest relevancy to lowest relevancy.
SELECT TOP 10 c.text
FROM c
ORDER BY RANK FullTextScore(c.text, ["keyword"])
This next example shows use of both FullTextScore
in the ORDER BY RANK
clause, and FullTextContains
in the WHERE
clause.
SELECT TOP 10 c.text
FROM c
WHERE FullTextContains(c.text, "keyword1")
ORDER BY RANK FullTextScore(c.text, ["keyword1", "keyword2"])
- This function requires a Full Text Index.
- This function can only be used in an
ORDER BY RANK
clause, or as an argument in anRRF
system function. - This function can’t be part of a projection (for example,
SELECT FullTextScore(c.text, "keyword") AS Score FROM c
is invalid.