Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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"])
ORDER BY RANK
clause, or as an argument in an RRF
system function.SELECT FullTextScore(c.text, "keyword") AS Score FROM c
is invalid.Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now