CosmosLinqExtensions.FullTextScore<TSource>(TSource, String[]) Method

Definition

Returns a BM25 score value that can only be used in an ORDER BY RANK function to sort results from highest relevancy to lowest relevancy. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/fulltextscore. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

public static double FullTextScore<TSource>(this TSource obj, params string[] terms);
static member FullTextScore : 'Source * string[] -> double
<Extension()>
Public Function FullTextScore(Of TSource) (obj As TSource, ParamArray terms As String()) As Double

Type Parameters

TSource

Parameters

obj
TSource
terms
String[]

A nonempty array of string literals.

Returns

Returns a BM25 score value that can only be used in an ORDER BY RANK clause.

Examples

var matched = documents.OrderByRank(document => document.Name.FullTextScore([<keyword1>], [keyword2]));

Applies to