Skip to content

Commit 78794cf

Browse files
committed
Review updates
1 parent 14517fb commit 78794cf

5 files changed

Lines changed: 173 additions & 100 deletions

File tree

src/MongoDB.Driver/IAggregateFluent.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
using System;
1717
using System.Collections.Generic;
18-
using System.Linq.Expressions;
1918
using System.Threading;
2019
using System.Threading.Tasks;
2120
using MongoDB.Bson;

src/MongoDB.Driver/PipelineStageDefinitionBuilder.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,10 +1478,9 @@ public static PipelineStageDefinition<TInput, TOutput> Search<TInput, TOutput>(
14781478
}
14791479
else
14801480
{
1481-
outputSerializer = args.SerializerRegistry.GetSerializer<TOutput>();
1482-
renderedSearchDefinition.Add("returnScope", new BsonDocument { { "path", returnScope.Render(args).FieldName } });
1483-
searchOptions = searchOptions.Clone();
1484-
searchOptions.ReturnStoredSource = true;
1481+
var renderedField = returnScope.Render(args);
1482+
outputSerializer = (IBsonSerializer<TOutput>)renderedField.ValueSerializer.GetItemSerializer();
1483+
renderedSearchDefinition.Add("returnScope", new BsonDocument { { "path", renderedField.FieldName } });
14851484
}
14861485

14871486
renderedSearchDefinition.Add("highlight", () => searchOptions.Highlight.Render(args), searchOptions.Highlight != null);

src/MongoDB.Driver/Search/SearchDefinitionBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public SearchDefinition<TDocument> GeoWithin<TCoordinates>(
320320
/// </summary>
321321
/// <typeparam name="TField">The type of the ancestor documents.</typeparam>
322322
/// <param name="path">The path from the root to the ancestor.</param>
323-
/// <param name="operator">The operator to execute at the root.</param>
323+
/// <param name="operator">The operator to execute in the ancestor context specified by <paramref name="path"/>.</param>
324324
/// <param name="score">The score modifier.</param>
325325
/// <returns>A search definition for the ancestor.</returns>
326326
public SearchDefinition<TDocument> HasAncestor<TField>(
@@ -336,7 +336,7 @@ public SearchDefinition<TDocument> HasAncestor<TField>(
336336
/// </summary>
337337
/// <typeparam name="TField">The type of the ancestor documents.</typeparam>
338338
/// <param name="path">The path from the root to the ancestor.</param>
339-
/// <param name="operator">The operator to execute at the root.</param>
339+
/// <param name="operator">The operator to execute in the ancestor context specified by <paramref name="path"/>.</param>
340340
/// <param name="score">The score modifier.</param>
341341
/// <returns>A search definition for the ancestor.</returns>
342342
public SearchDefinition<TDocument> HasAncestor<TField>(

src/MongoDB.Driver/Search/SearchTrackingOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public string SearchTerms
3838
/// Creates a clone of the options.
3939
/// </summary>
4040
/// <returns>A clone of the options.</returns>
41-
public SearchTrackingOptions Clone() => new() { SearchTerms = SearchTerms };
41+
public SearchTrackingOptions Clone() => new() { _searchTerms = SearchTerms };
4242

4343
internal BsonDocument Render() =>
4444
new()

0 commit comments

Comments
 (0)