I had billions of document in an index. I read half of them with java-high-level-client until my code got an exception. so I need to skip these documents. I found search_after as a solution but I have no idea how it is working on the match-all query and without sorting.
here is the simplified version of my search request :
SearchRequest searchRequest = new SearchRequest("Index");
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
// searchSourceBuilder.searchAfter() // need to skip x documents or a given uid
sourceBuilder.timeout(new TimeValue(10, TimeUnit.MINUTES));
searchRequest.scroll(new TimeValue(10, TimeUnit.MINUTES));
SearchResponse searchResponse = highLevelClient.search(searchRequest);