title: Paging problems in Elasticsearch SQL API
body: <p>My existing system has some search SQL procedures that returns the data based on some filters. Now, to improve searches we have decided to use Elasticsearch for all our searches. We are in phase of making a prototype for now.</p>
  
  <p>Below is what i have done till now:-</p>
  
  <ol>
  <li>De-normalize all the data from my RDBMS and store into Elasticsearch using Logstash.</li>
  <li>Query data from Elasticsearch based on the parameters using Elastisearch SQL API.</li>
  </ol>
  
  <p><strong>The main problem is the Pagination</strong>. Elasticsearch Sql has support for sending fetch_size parameter and in result it returns the cursor for the next set of records. </p>
  
  <p>Cursor is fine if you want to get to the next paged set of results, but if a user wants to go from page 10 to page 100, how can we achieve that ?</p>
  
  <p>I also searched for offset and skip support in elasticsearch SQL but could not find any references. </p>
  
  <p>Has anyone faced such an issue ? I would appreciate any help or suggestions.</p>
  
  <p>I tried to follow the link <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html</a> </p>
  
  <p>{
      "query" : "Select client_clientid, clientpolicy_policyname from client_paged_list group by client_clientid, clientpolicy_policyname",
      "fetch_size": 5
  }</p>