-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Adds LINQ extension method for ORDER BY RANK, FullTextScore and RRF #4993
base: master
Are you sure you want to change the base?
Conversation
/// </example> | ||
public static Func<TSource, object> FullTextScore<TSource>(this TSource obj, string[] terms) | ||
{ | ||
throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); //Todo: change this to LINQNotImplemented once the FTContains PR is checked in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// </example> | ||
public static Func<TSource, object> RRF<TSource>(this object obj, params Func<TSource, object>[] scoringFunctions) | ||
{ | ||
throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); //Todo: change this to LINQNotImplemented once the FTContains PR is checked in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1159,8 +1159,9 @@ private static Collection VisitMethodCall(MethodCallExpression inputExpression, | |||
context.PushMethod(inputExpression); | |||
|
|||
Type declaringType = inputExpression.Method.DeclaringType; | |||
if ((declaringType != typeof(Queryable) && declaringType != typeof(Enumerable)) | |||
|| !inputExpression.Method.IsStatic) | |||
if ((declaringType != typeof(Queryable) && declaringType != typeof(Enumerable) /*LINQ Methods*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((declaringType != typeof(Queryable) && declaringType != typeof(Enumerable)) | ||
|| !inputExpression.Method.IsStatic) | ||
if ((declaringType != typeof(Queryable) && declaringType != typeof(Enumerable) /*LINQ Methods*/ | ||
&& declaringType != typeof(CosmosLinqExtensions) /*OrderByRank*/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#else | ||
internal | ||
#endif | ||
sealed class SqlOrderByRankClause : SqlObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this class needs to stay (let's discuss if that's the case since it's not desirable to introduce another type for this small a change in the model), there should be a common base class between SqlOrderByClause and SqlOrderByRankClause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to have parity with the BE. Let me check how the DOM is there and i will reflect it in this change
@@ -59,14 +59,15 @@ public ParameterExpression Alias | |||
|
|||
private SqlSelectClause selectClause; | |||
private SqlWhereClause whereClause; | |||
private SqlOrderByClause orderByClause; | |||
private SqlOrderByClause orderByClause; | |||
private SqlOrderByRankClause orderbyRankClause; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that these are mutually exclusive, we should have a single type SqlOrderByClause representing both.
//protected override SqlScalarExpression VisitExplicit(MethodCallExpression methodCallExpression, TranslationContext context) | ||
//{ | ||
// return null; | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove if not needed.
Pull Request Template
Description
This PR adds extension methods for ORDER BY RANK, FullTextScore, and RRF to the LINQ extension method support.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber