title: How to use search_after in Elastic High Level Rest Client for pagination
body: <p>I am using elastic RestHighLevelClient to talk to ES. I am able to query basic queries. Although i am trying to use teh search_after api to design a paginated api from my front end queries. Although query_after is simple to use in the RestLowLevelClient api, i am not able to figure how to use it in the HighLevel API.</p>
  
  <p>Looks like the lucene api has SearchAfterSortedDocQuery, but i am not able to figure how to use it with the elastic search api. For example: in the code below  i initialize SearchAfterSortedDocQuery query but not sure how to use it .</p>
  
  <pre><code>        RestHighLevelClient client = ESRestClient.getClient();
  
          SearchRequest searchRequest = new SearchRequest();
          SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
          searchSourceBuilder.query(QueryBuilders.termQuery("field1",value1));
          searchSourceBuilder.query(QueryBuilders.termQuery("field2",value2));
  
          searchSourceBuilder.from(0);
          searchSourceBuilder.size(limit);
          SortField[] sortFields = new SortField[2];
  
          sortFields[0]= new SortField("field1", SortField.Type.LONG);
          sortFields[1]= new SortField("field2", SortField.Type.LONG);
  
  
          FieldDoc fieldDoc = new FieldDoc(0,0); //Is this correct? how to initialize field doc?
          fieldDoc.fields = new Object[2];
          fieldDoc.fields[0] = new Long("-156034");
          fieldDoc.fields[1] = new Long("2297416849");
  
          SearchAfterSortedDocQuery query = new SearchAfterSortedDocQuery(new Sort(sortFields), fieldDoc);
          searchRequest.source(searchSourceBuilder);
          searchRequest.indices("index1");
  
          try {
              SearchResponse response = client.search(searchRequest, RequestOptions.DEFAULT);
              System.out.println(response);
          }
          catch(IOException e){
              System.out.println(e);
          }
  
      }
  </code></pre>