Pagination with field collapse

How is it possible to implement pagination in elastic search when we are field collapsing and returning top 5 results from each index.

GET /my-index-000001/_search
  "query": {
    "match": {
      "message": "GET /search"
  "collapse": {
    "field": "user.type",                       
    "inner_hits": {
      "name": "top5",                  
      "size": 5                       

In a normal search query it easily done using Size and From attributes in the search request.
But how does it work when someone is using field collapsing and we want to skip first n results and return next 5.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.