Scroll API for java api 2.3.0

Hi !

I am practicing with the java api for elasticsearch and have a question for scroll api.

According to the online document, SearchType.SCAN should be defined for for setSearchType.

SearchResponse scrollResp = client.prepareSearch(test)
.setScroll(new TimeValue(60000))
.setSize(100).execute().actionGet(); //100 hits per shard will be returned for each scroll

However, according to the search type page, SearchType SCAN is deprecated from v 2.1.0.

I have checked the code and SCAN is not included in the enum.

So, should I keep using the search type SCAN when I use the scroll api? If not , I appreciate if someone can educate me how to call the SearchResponse object for scroll api in correct way.

I agree that we should have updated the guide within this change:

You can omit .setSearchType(SearchType.SCAN) but add a sort on _doc. Something similar to:

  "sort": [

Do you want to contribute a documentation change?
If so, you just have to propose changes for this file:

I'll be happy to merge them.

Thanks for reporting!

1 Like

Hello David.

I would be happy to contribute.

I will make changes in the document.


Would you have the programmatic equivalent of that? Have a very similar use case to port to 5.2.1.