Hi I am reading the code of class ConjunctionDISI .and about the method nextDoc , Suppose that the sub-disi is emtpy in the lead1.lead2,should there be that it can return immediately when the input doc==NO_MORE_DOCS?
private int doNext(int doc) throws IOException { advanceHead: for (; ; ) { assert doc == lead1.docID(); //assumpt doc==NO_MORE_DOCS ,it return if(doc==NO_MORE_DOCS){ return NO_MORE_DOCS; } // find agreement between the two iterators with the lower costs // we special case them because they do not need the // 'other.docID() < doc' check that the 'others' iterators need final int next2 = lead2.advance(doc); if (next2 != doc) { doc = lead1.advance(next2); if(doc==NO_MORE_DOCS){ return NO_MORE_DOCS; } if (next2 != doc) { continue; } } ..left omited... }