Its a bug: its already fixed for 4.3 (coming soon): https://issues.apache.org/jira/browse/LUCENE-4888
On Fri, Apr 19, 2013 at 1:09 PM, Ravikumar Govindarajan < ravikumar.govindara...@gmail.com> wrote: > When writing a custom codec, I encountered an issue in SloppyPhraseScorer. > I am using lucene-4.2 GA. > > public int nextDoc() > { > return advance(max.doc) > } > > This in-turn calls my DocsAndPositionEnum.advance(int target). > > Intially this seems to call with advance(-1). It's kind of unsettling to > see an instruction from lucene API to advance past a negative docId. Also, > sometimes I receive the advance call to the same doc, twice. > > Should it be advance(max.doc+1) or something? Has someone faced this issue > before? > > --Ravi >