@@ -1316,6 +1316,7 @@ public static PipelineStageDefinition<TInput, TOutput> Project<TInput, TOutput>(
13161316 /// <param name="highlight">The highlight options.</param>
13171317 /// <param name="indexName">The index name.</param>
13181318 /// <param name="count">The count options.</param>
1319+ /// <param name="sort">The sort specification.</param>
13191320 /// <param name="returnStoredSource">
13201321 /// Flag that specifies whether to perform a full document lookup on the backend database
13211322 /// or return only stored source fields directly from Atlas Search.
@@ -1330,6 +1331,7 @@ public static PipelineStageDefinition<TInput, TInput> Search<TInput>(
13301331 SearchHighlightOptions < TInput > highlight = null ,
13311332 string indexName = null ,
13321333 SearchCountOptions count = null ,
1334+ SortDefinition < TInput > sort = null ,
13331335 bool returnStoredSource = false ,
13341336 bool scoreDetails = false )
13351337 {
@@ -1343,6 +1345,7 @@ public static PipelineStageDefinition<TInput, TInput> Search<TInput>(
13431345 var renderedSearchDefinition = searchDefinition . Render ( s , sr ) ;
13441346 renderedSearchDefinition . Add ( "highlight" , ( ) => highlight . Render ( s , sr ) , highlight != null ) ;
13451347 renderedSearchDefinition . Add ( "count" , ( ) => count . Render ( ) , count != null ) ;
1348+ renderedSearchDefinition . Add ( "sort" , ( ) => sort . Render ( s , sr ) , sort != null ) ;
13461349 renderedSearchDefinition . Add ( "index" , indexName , indexName != null ) ;
13471350 renderedSearchDefinition . Add ( "returnStoredSource" , returnStoredSource , returnStoredSource ) ;
13481351 renderedSearchDefinition . Add ( "scoreDetails" , scoreDetails , scoreDetails ) ;
0 commit comments