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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]