Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/416#discussion_r210306003
--- Diff:
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformer.java
---
@@ -227,27 +225,28 @@ private static String getPathByDocId(int segDocId,
SortedDocValues segPathDocVal
/**
*
- * @param segDocBaseId base docID of the segment
- * @param RootId docID if the current root document
- * @param lastDescendantId lowest docID of the root document's descendant
- * @return the docID to loop and to not surpass limit of descendants to
match specified by query
+ * @param RootDocId docID if the current root document
+ * @param lowestChildDocId lowest docID of the root document's descendant
+ * @return the docID to loop and not surpass limit of descendants to
match specified by query
*/
- private int calcLimitIndex(int segDocBaseId, int RootId, int
lastDescendantId) {
- int i = segDocBaseId + RootId - 1; // the child document with the
highest docID
- final int prevSegRootId = segDocBaseId + lastDescendantId;
- assert prevSegRootId < i; // previous rootId should be smaller then
current RootId
+ private int calcDocIdToIterateFrom(int lowestChildDocId, int RootDocId) {
+ assert lowestChildDocId < RootDocId; // first childDocId should be
smaller then current RootId
--- End diff --
if the root doc has no children, this assertion would fail, right? Hmm;
should be tested we don't blow up/fail.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]