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_r274350444
 
 

 ##########
 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) {
+      int rows = Integer.parseInt(params.get("rows"));
+      //rows=0 has an existing side effect of returning numFound=0 and no docs 
in /export component. So following logic effectively kicks in when rows>0
+      maxDocs = ( rows >= 0 && rows < totalHits ) ? rows:totalHits;
+    }
 
 Review comment:
   what happens when `rows` is not specified? 

----------------------------------------------------------------
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

Reply via email to