LUCENE-3069: remove redundant info for fields without payload

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3069@1502991 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Han Jiang 2013-07-14 16:31:00 +00:00
parent 3c82f0a0d2
commit 9bc7640fd1
2 changed files with 12 additions and 4 deletions

View File

@ -210,7 +210,9 @@ public final class TempPostingsReader extends TempPostingsReaderBase {
termState.docStartFP = longs[0];
if (fieldHasPositions) {
termState.posStartFP = longs[1];
termState.payStartFP = longs[2];
if (fieldHasOffsets || fieldHasPayloads) {
termState.payStartFP = longs[2];
}
}
if (termState.docFreq == 1) {

View File

@ -206,9 +206,13 @@ public final class TempPostingsWriter extends TempPostingsWriterBase {
fieldHasPayloads = fieldInfo.hasPayloads();
skipWriter.setField(fieldHasPositions, fieldHasOffsets, fieldHasPayloads);
if (fieldHasPositions) {
return 3; // doc + pos + pay FP
if (fieldHasPayloads || fieldHasOffsets) {
return 3; // doc + pos + pay FP
} else {
return 2; // doc + pos FP
}
} else {
return 1; // docFP
return 1; // doc FP
}
}
@ -503,7 +507,9 @@ public final class TempPostingsWriter extends TempPostingsWriterBase {
longs[0] = docTermStartFP;
if (fieldHasPositions) {
longs[1] = posTermStartFP;
longs[2] = payTermStartFP;
if (fieldHasPayloads || fieldHasOffsets) {
longs[2] = payTermStartFP;
}
}
if (singletonDocID != -1) {
out.writeVInt(singletonDocID);