diff --git a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java index 3c8e324aa2d..1803401d6ae 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListReader.java @@ -197,7 +197,9 @@ class SepSkipListReader extends MultiLevelSkipListReader { docIndex[level].read(skipStream, false); if (!omitTF) { posIndex[level].read(skipStream, false); - payloadPointer[level] += skipStream.readVInt(); + if (currentFieldStoresPayloads) { + payloadPointer[level] += skipStream.readVInt(); + } } return delta; diff --git a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java index 866bac6e390..4ec9203af00 100644 --- a/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/sep/SepSkipListWriter.java @@ -188,7 +188,9 @@ class SepSkipListWriter extends MultiLevelSkipListWriter { if (!omitTF) { posIndex[level].mark(); posIndex[level].write(skipBuffer, false); - skipBuffer.writeVInt((int) (curPayloadPointer - lastSkipPayloadPointer[level])); + if (curStorePayloads) { + skipBuffer.writeVInt((int) (curPayloadPointer - lastSkipPayloadPointer[level])); + } } lastSkipDoc[level] = curDoc;