Hi Adrien suppose that conjunction query like (term1 AND term2 AND term3) ,if the term1 does not exist ,and then the loop execution may cause unnecessary overhead.(sorry I have not yet find out whether there is any filter work before the doNext()..
Best Regard Adrien Grand <jpou...@gmail.com> 于2023年10月1日周日 22:30写道: > Hello, > > This change would be correct, but it would only save work when the > conjunction is exhausted, and add overhead otherwise? > > Le sam. 30 sept. 2023, 16:20, YouPeng Yang <yypvsxf19870...@gmail.com> a > écrit : > >> 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... >> } >> >