title: Elastic search query help on pagination
body: <p>Unhandled questions KPI should display top 10 records in descending order also need to add one field for timestamp. And for all additional records there should be pagination available. Members should be able to view additional records by navigating through pagination options.</p>
  <p>My requirements is for the pagination record should come like 1 to 10 and 11 to 20 and 21 to 30 like wise in this range I  should get the output.</p>
  <p>I tried the below query but when I execute the query its not showing up the timestamp field. And it is only giving me the question.keyword. Also If i give the partition range between 11 to 20 it is still showing me the 1st ten records . Whatever range I give I am getting the same output and there is no change in the output</p>
  <p>Please correct my below query.</p>
  <pre><code>  &quot;size&quot;: 0,
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: [
          {
            &quot;term&quot;: {
              &quot;answer.keyword&quot;: &quot;UNHANDLED&quot;
            }
          },
          {
            &quot;term&quot;: {
              &quot;source.keyword&quot;: &quot;On_board&quot;
            }
          }
        ]
      }
    },
    &quot;aggs&quot;: {
      &quot;MyBuckets&quot;: {
        &quot;terms&quot;: {
          &quot;field&quot;: &quot;question.keyword&quot;,
          &quot;order&quot;: {
            &quot;_count&quot;: &quot;desc&quot;
          },
          &quot;size&quot;: &quot;10&quot;
        },
        &quot;aggs&quot;: {
          &quot;MyBuckets&quot;: {
            &quot;terms&quot;: {
              &quot;field&quot;: &quot;timestamp&quot;,
              &quot;order&quot;: {
                &quot;_count&quot;: &quot;desc&quot;
              },
              &quot;size&quot;: &quot;10&quot;,
              &quot;include&quot;: {
                &quot;partition&quot;: 11,
                &quot;num_partitions&quot;: 20
              }
            }
          }
        }
      }
    }
  }```
  </code></pre>