diegoceccarelli commented on a change in pull request #636: SOLR-10409 - Added support for rows=x in /export to limit number of docs exported (With unit tests) URL: https://github.com/apache/lucene-solr/pull/636#discussion_r274350016
########## File path: solr/core/src/java/org/apache/solr/handler/export/ExportWriter.java ########## @@ -188,8 +189,16 @@ public void write(OutputStream os) throws IOException { } } SolrParams params = req.getParams(); + + maxDocs = totalHits; + + if ( params.get("rows") != null) { Review comment: you can use ``` Integer rows = params.getInt("rows"); if (rows != null) { maxDocs = ( rows >= 0 && rows < totalHits ) ? rows : totalHits; } ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org