Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Dec 2, 2016

Exposes a sliced scroll behind an observable with an optional max degree
of parallelism

var scrollObservable = this._client.ScrollAll<SmallObject>("1m", slices, s => s
	.MaxDegreeOfParallelism(slices/ 2)
	.Search(search => search
		.Index(index)
		.AllTypes()
		.MatchAll()
	)
);

Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, just a few small nitpicks 😄

Are there tests for the ScrollAll observable too?

public ISearchResponse<T> SearchResponse { get; internal set; }

public int Scroll { get; internal set; }
public long Scroll { get; internal set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch 👍

private readonly ISearchRequest _searchRequest;
private readonly IConnectionSettingsValues _connectionSettings;
private readonly IElasticClient _client;
private static IList<ISort> DocOrderSort = new ReadOnlyCollection<ISort>(new List<ISort> { new SortField { Field = "_doc" } });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should DocOrderSort be applied only if a sort is not specified on the search request? If it will always be applied, I think it should also be mentioned in the comment on Search on IScrollAllRequest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

}
public ScrollAllRequest(Time scrollTime, int numberOfSlices, Field routingField) : this(scrollTime, numberOfSlices)
{
((IScrollAllRequest)this).RoutingField = routingField;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nitpick: the cast to interface is not needed

<Compile Include="Search\Request\SlicedScrollSearchUsageTests.cs" />
<Compile Include="Search\Request\SearchAfterUsageTests.cs" />
<Compile Include="Search\Scroll\Scroll\SlicedScrollApiTests.cs" />
<Compile Include="Search\Scroll\Scroll\SlicedScrollSearchApiTests.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be called ScrollAllApiTests.cs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No :) These just test the sliced scroll on _search. I've added ScrollAll observable tests to bulkall to save on running times.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool cool, I thought I must have missed it 👍

Exposes a sliced scroll behind an observable with an optional max degree
of parallelism
…et scroll to _doc order if the user did not supply a sort of their own
@Mpdreamz Mpdreamz merged commit 1e98d3e into master Dec 7, 2016
Mpdreamz added a commit that referenced this pull request Dec 7, 2016
* ScrollAll()

Exposes a sliced scroll behind an observable with an optional max degree
of parallelism

* implemented review feedback from @russcam, unneccessary cast + only set scroll to _doc order if the user did not supply a sort of their own
@Mpdreamz
Copy link
Member Author

Mpdreamz commented Dec 7, 2016

ported to 5.x

@Mpdreamz Mpdreamz deleted the feature/scroll-all branch December 7, 2016 08:41
@russcam russcam added the v5.0.0 label Dec 13, 2016
awelburn pushed a commit to Artesian/elasticsearch-net that referenced this pull request Nov 6, 2017
* ScrollAll()

Exposes a sliced scroll behind an observable with an optional max degree
of parallelism

* implemented review feedback from @russcam, unneccessary cast + only set scroll to _doc order if the user did not supply a sort of their own
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants