iverase commented on a change in pull request #7: URL: https://github.com/apache/lucene/pull/7#discussion_r745889169
########## File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java ########## @@ -279,7 +437,91 @@ public int getNumLeaves() { numLeaves = rightMostLeafNode - leftMostLeafNode + 1 + leafNodeOffset; } assert numLeaves == getNumLeavesSlow(nodeID) : numLeaves + " " + getNumLeavesSlow(nodeID); - return numLeaves; + return rightMostLeafNode == this.rightMostLeafNode + ? (long) (numLeaves - 1) * config.maxPointsInLeafNode + lastLeafNodePointCount + : (long) numLeaves * config.maxPointsInLeafNode; + } + + @Override + public void visitDocIDs(PointValues.IntersectVisitor visitor) throws IOException { + addAll(visitor, false); + } + + public void addAll(PointValues.IntersectVisitor visitor, boolean grown) throws IOException { + if (grown == false) { + final long size = size(); + if (size <= Integer.MAX_VALUE) { + visitor.grow((int) size); + grown = true; + } Review comment: I think this is the same strategy we are using in the current code: https://github.com/apache/lucene/blob/94b66c0ed279fe23656d451fecd56fdfd106e1ea/lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java#L416 Still I will leave a comment -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org