Skip to content

Commit 07167c7

Browse files
committed
fix api compat issues
1 parent 3a1f07b commit 07167c7

File tree

4 files changed

+22
-36
lines changed

4 files changed

+22
-36
lines changed

src/MongoDB.Driver/AggregateFluent.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,6 @@ public override IAggregateFluent<TNewResult> Unwind<TNewResult>(FieldDefinition<
379379
return WithPipeline(_pipeline.Unwind(field, options));
380380
}
381381

382-
public override IAggregateFluent<TResult> Rerank(
383-
RerankQuery query,
384-
FieldDefinition<TResult> path,
385-
int numDocsToRerank,
386-
string model)
387-
{
388-
return WithPipeline(_pipeline.Rerank(query, path, numDocsToRerank, model));
389-
}
390-
391382
public override IAggregateFluent<TResult> VectorSearch(
392383
FieldDefinition<TResult> field,
393384
QueryVector queryVector,

src/MongoDB.Driver/AggregateFluentBase.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,6 @@ public virtual IAggregateFluent<TNewResult> Unwind<TNewResult>(FieldDefinition<T
331331
throw new NotImplementedException();
332332
}
333333

334-
/// <inheritdoc />
335-
public virtual IAggregateFluent<TResult> Rerank(
336-
RerankQuery query,
337-
FieldDefinition<TResult> path,
338-
int numDocsToRerank,
339-
string model)
340-
{
341-
throw new NotImplementedException();
342-
}
343-
344334
/// <inheritdoc />
345335
public virtual IAggregateFluent<TResult> VectorSearch(
346336
FieldDefinition<TResult> field,

src/MongoDB.Driver/IAggregateFluent.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -545,20 +545,6 @@ IAggregateFluent<TResult> UnionWith<TWith>(
545545
/// <returns>The fluent aggregate interface.</returns>
546546
IAggregateFluent<TNewResult> Unwind<TNewResult>(FieldDefinition<TResult> field, AggregateUnwindOptions<TNewResult> options = null);
547547

548-
/// <summary>
549-
/// Appends a $rerank stage.
550-
/// </summary>
551-
/// <param name="query">The rerank query.</param>
552-
/// <param name="path">The field to send to the reranker.</param>
553-
/// <param name="numDocsToRerank">The maximum number of documents to rerank.</param>
554-
/// <param name="model">The reranking model name.</param>
555-
/// <returns>The fluent aggregate interface.</returns>
556-
IAggregateFluent<TResult> Rerank(
557-
RerankQuery query,
558-
FieldDefinition<TResult> path,
559-
int numDocsToRerank,
560-
string model);
561-
562548
/// <summary>
563549
/// Appends a vector search stage.
564550
/// </summary>

src/MongoDB.Driver/IAggregateFluentExtensions.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,27 @@ public static IAggregateFluent<TNewResult> Unwind<TResult, TNewResult>(this IAgg
10411041
return IAsyncCursorSourceExtensions.SingleOrDefaultAsync(aggregate.Limit(2), cancellationToken);
10421042
}
10431043

1044+
/// <summary>
1045+
/// Appends a $rerank stage.
1046+
/// </summary>
1047+
/// <typeparam name="TResult">The type of the result.</typeparam>
1048+
/// <param name="aggregate">The aggregate.</param>
1049+
/// <param name="query">The rerank query.</param>
1050+
/// <param name="path">The field to send to the reranker.</param>
1051+
/// <param name="numDocsToRerank">The maximum number of documents to rerank.</param>
1052+
/// <param name="model">The reranking model name.</param>
1053+
/// <returns>The fluent aggregate interface.</returns>
1054+
public static IAggregateFluent<TResult> Rerank<TResult>(
1055+
this IAggregateFluent<TResult> aggregate,
1056+
RerankQuery query,
1057+
FieldDefinition<TResult> path,
1058+
int numDocsToRerank,
1059+
string model)
1060+
{
1061+
Ensure.IsNotNull(aggregate, nameof(aggregate));
1062+
return aggregate.AppendStage(PipelineStageDefinitionBuilder.Rerank(query, path, numDocsToRerank, model));
1063+
}
1064+
10441065
/// <summary>
10451066
/// Appends a $rerank stage.
10461067
/// </summary>
@@ -1060,8 +1081,7 @@ public static IAggregateFluent<TResult> Rerank<TResult, TField>(
10601081
string model)
10611082
{
10621083
Ensure.IsNotNull(aggregate, nameof(aggregate));
1063-
1064-
return aggregate.Rerank(query, new ExpressionFieldDefinition<TResult>(path), numDocsToRerank, model);
1084+
return aggregate.AppendStage(PipelineStageDefinitionBuilder.Rerank(query, path, numDocsToRerank, model));
10651085
}
10661086

10671087
/// <summary>
@@ -1083,7 +1103,6 @@ public static IAggregateFluent<TResult> Rerank<TResult, TField>(
10831103
params Expression<Func<TResult, TField>>[] paths)
10841104
{
10851105
Ensure.IsNotNull(aggregate, nameof(aggregate));
1086-
10871106
return aggregate.AppendStage(PipelineStageDefinitionBuilder.Rerank(query, numDocsToRerank, model, paths));
10881107
}
10891108

0 commit comments

Comments
 (0)