Sometimes TCBJQ returns parent-doc itself as a child-doc. I traced it down to the following code...
public int advance(int childTarget) throws IOException {
.......
final int firstChild = parentBits.prevSetBit(parentDoc-1);
//System.out.println(" firstChild=" + firstChild);
childTarget = Math.max(childTarget, firstChild);
........
}
Shoudn't it be
final int firstChild = 1 + parentBits.prevSetBit(parentDoc-1) ??
--
Ravi
