@@ -231,8 +231,9 @@ public void MustNot()
231231 {
232232 var result = SearchSingle (
233233 Builders . Search . Compound ( ) . MustNot (
234- Builders . Search . Phrase ( x => x . Body , "life, liberty" ) ) ) ;
235- result . Title . Should ( ) . Be ( "Gettysburg Address" ) ;
234+ Builders . Search . Phrase ( x => x . Body , "life, liberty" ) ) ,
235+ sort : Builders . Sort . Descending ( x => x . Title ) ) ;
236+ result . Title . Should ( ) . Be ( "US Constitution" ) ;
236237 }
237238
238239 [ Fact ]
@@ -467,9 +468,12 @@ public void Wildcard()
467468 private List < AirbnbListing > GeoSearch ( SearchDefinition < AirbnbListing > searchDefintion ) =>
468469 GetGeoTestCollection ( ) . Aggregate ( ) . Search ( searchDefintion ) . ToList ( ) ;
469470
470- private HistoricalDocument SearchSingle ( SearchDefinition < HistoricalDocument > searchDefintion , ProjectionDefinition < HistoricalDocument , HistoricalDocument > projectionDefinition = null )
471+ private HistoricalDocument SearchSingle (
472+ SearchDefinition < HistoricalDocument > searchDefintion ,
473+ ProjectionDefinition < HistoricalDocument , HistoricalDocument > projectionDefinition = null ,
474+ SortDefinition < HistoricalDocument > sort = null )
471475 {
472- var fluent = GetTestCollection ( ) . Aggregate ( ) . Search ( searchDefintion ) ;
476+ var fluent = GetTestCollection ( ) . Aggregate ( ) . Search ( searchDefintion , sort : sort ) ;
473477
474478 if ( projectionDefinition != null )
475479 {
0 commit comments