LUCENE-2905: don't write abs skip pointer until we have to, the block might be all low-freq terms

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1071593 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-02-17 12:22:49 +00:00
parent 07aca888ba
commit 28cf54a4cc
2 changed files with 3 additions and 7 deletions

View File

@ -242,7 +242,7 @@ public class SepPostingsReaderImpl extends PostingsReaderBase {
} }
//System.out.println(" skipFP=" + termState.skipFP); //System.out.println(" skipFP=" + termState.skipFP);
} else if (isFirstTerm) { } else if (isFirstTerm) {
termState.skipFP = termState.bytesReader.readVLong(); termState.skipFP = 0;
} }
} }

View File

@ -289,12 +289,8 @@ public final class SepPostingsWriterImpl extends PostingsWriterBase {
} }
lastSkipFP = skipFP; lastSkipFP = skipFP;
} else if (isFirstTerm) { } else if (isFirstTerm) {
// TODO: this is somewhat wasteful; eg if no terms in // lazily write an absolute delta if a term in this block requires skip data.
// this block will use skip data, we don't need to lastSkipFP = 0;
// write this:
final long skipFP = skipOut.getFilePointer();
indexBytesWriter.writeVLong(skipFP);
lastSkipFP = skipFP;
} }
lastDocID = 0; lastDocID = 0;