Skip to content

Commit 43d5e55

Browse files
committed
implemented review feedback from @russcam, unneccessary cast + only set scroll to _doc order if the user did not supply a sort of their own
1 parent 645c73f commit 43d5e55

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Nest/Document/Multiple/ScrollAll/ScrollAllObservable.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public ScrollAllObservable(
2929
this._connectionSettings = connectionSettings;
3030
this._scrollAllRequest = scrollAllRequest;
3131
this._searchRequest = scrollAllRequest?.Search ?? new SearchRequest<T>();
32-
this._searchRequest.Sort = DocOrderSort;
32+
if (this._searchRequest.Sort == null)
33+
this._searchRequest.Sort = DocOrderSort;
3334
this._searchRequest.RequestParameters.Scroll(this._scrollAllRequest.ScrollTime.ToTimeSpan());
3435
this._client = client;
3536
this._compositeCancelTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);

src/Nest/Document/Multiple/ScrollAll/ScrollAllRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ScrollAllRequest(Time scrollTime, int numberOfSlices)
5050
}
5151
public ScrollAllRequest(Time scrollTime, int numberOfSlices, Field routingField) : this(scrollTime, numberOfSlices)
5252
{
53-
((IScrollAllRequest)this).RoutingField = routingField;
53+
this.RoutingField = routingField;
5454
}
5555
}
5656

0 commit comments

Comments
 (0)