how to fetch records equal to pageSize while using queryForCursor in SolrTemplate <p>I want to fetch records from solr using cursors as I have large resultset size. I m using SolrTemplate.queryForCursor() method by passing query object to this. But the resultCursor which is of type Cursor has all data in it. I want to stop reading from cursor when my pageSize is hit.</p> <pre><code>Criteria query = new Criteria("UserName").is ("abc"); query.setRows(10); // As i want to have fetch 10 records at a time Cursor&lt;T&gt; resultCusrsor = solrTemplate.queryForCursor(query,Entity.class); while(resultCursor.hasNext() ){ System.out.println( "Result : " + resultCusrsor.next()); } </code></pre> <p>The while loop here keeps printing all records by fetching 10 at a time. If my pagesize is 100, I want to fetch 10 records 10 times using cursor, but how do I stop at 100th record?</p>