You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by "袁武 [GMail]" <yu...@gmail.com> on 2011/04/01 09:54:16 UTC

A likely bug of TermsPosition.nextPosition

Hi, dear experts:

When IndexReader.termsPositions is used to access specific terms, the call to TermsPosition.nextPosition success if TermsPosition.next is used. But if TermsPosition.skipTo is used instead of TermsPosition.next, a java.lang.IllegalArgumentException will be thrown, as bellows. 

 java.lang.IllegalArgumentException: Negative position
    at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:610)
    at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:161)
    at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:213)
    at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39)
    at org.apache.lucene.store.IndexInput.readVInt(IndexInput.java:92)
    at org.apache.lucene.store.BufferedIndexInput.readVInt(BufferedIndexInput.java:181)
    at org.apache.lucene.index.SegmentTermPositions.readDeltaPosition(SegmentTermPositions.java:75)
    at org.apache.lucene.index.SegmentTermPositions.skipPositions(SegmentTermPositions.java:130)
    at org.apache.lucene.index.SegmentTermPositions.lazySkip(SegmentTermPositions.java:168)
    at org.apache.lucene.index.SegmentTermPositions.nextPosition(SegmentTermPositions.java:69)

In my further study, I found that if docid execeed 1044278, the exception occurs everytime, for the small ones,  the exception never occur. BTW, the total number of documents is about 1344278, and are never deleted.
 
Thanks.

2011-04-01 



Yuan Wu [GMail]