Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/416#discussion_r213540255
  
    --- Diff: 
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformer.java 
---
    @@ -123,6 +124,16 @@ public void transform(SolrDocument rootDoc, int 
rootDocId) {
     
             // Do we need to do anything with this doc (either ancestor or 
matched the child query)
             if (isAncestor || childDocSet == null || 
childDocSet.exists(docId)) {
    +
    +          if(limit != -1) {
    +            if(!isAncestor) {
    +              if(matches == limit) {
    +                continue;
    +              }
    +              ++matches;
    --- End diff --
    
    I think matches should be incremented if it's in childDocSet (includes 
childDocSet being null).  Wether it's an ancestor or not doesn't matter I 
think.  You could pull out a new variable isInChildDocSet.  Or I suppose simply 
consider all a match; what I see what you just did as I write this; that's fine 
too.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to