I have such problem now, I have a requirement to migrate from spring data elasticsearch to restHighLevelClient, and also have to implement pagination, which was pretty easy in Spring data.
SearchResponse response = esClient.search(new SearchRequest("person")
.source(new SearchSourceBuilder()
.query(query)
.from(from)
.size(size)
));
with this we can specify the whole size of items only, which has nothing to do with pageSize (i.e the item size on each page). Now please any way of specifying the pageSize on "restHighLevelClient"