mirror of https://github.com/apache/lucene.git
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:
parent
3c82f0a0d2
commit
9bc7640fd1
|
@ -210,8 +210,10 @@ public final class TempPostingsReader extends TempPostingsReaderBase {
|
||||||
termState.docStartFP = longs[0];
|
termState.docStartFP = longs[0];
|
||||||
if (fieldHasPositions) {
|
if (fieldHasPositions) {
|
||||||
termState.posStartFP = longs[1];
|
termState.posStartFP = longs[1];
|
||||||
|
if (fieldHasOffsets || fieldHasPayloads) {
|
||||||
termState.payStartFP = longs[2];
|
termState.payStartFP = longs[2];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (termState.docFreq == 1) {
|
if (termState.docFreq == 1) {
|
||||||
termState.singletonDocID = in.readVInt();
|
termState.singletonDocID = in.readVInt();
|
||||||
|
|
|
@ -206,7 +206,11 @@ public final class TempPostingsWriter extends TempPostingsWriterBase {
|
||||||
fieldHasPayloads = fieldInfo.hasPayloads();
|
fieldHasPayloads = fieldInfo.hasPayloads();
|
||||||
skipWriter.setField(fieldHasPositions, fieldHasOffsets, fieldHasPayloads);
|
skipWriter.setField(fieldHasPositions, fieldHasOffsets, fieldHasPayloads);
|
||||||
if (fieldHasPositions) {
|
if (fieldHasPositions) {
|
||||||
|
if (fieldHasPayloads || fieldHasOffsets) {
|
||||||
return 3; // doc + pos + pay FP
|
return 3; // doc + pos + pay FP
|
||||||
|
} else {
|
||||||
|
return 2; // doc + pos FP
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return 1; // doc FP
|
return 1; // doc FP
|
||||||
}
|
}
|
||||||
|
@ -503,8 +507,10 @@ public final class TempPostingsWriter extends TempPostingsWriterBase {
|
||||||
longs[0] = docTermStartFP;
|
longs[0] = docTermStartFP;
|
||||||
if (fieldHasPositions) {
|
if (fieldHasPositions) {
|
||||||
longs[1] = posTermStartFP;
|
longs[1] = posTermStartFP;
|
||||||
|
if (fieldHasPayloads || fieldHasOffsets) {
|
||||||
longs[2] = payTermStartFP;
|
longs[2] = payTermStartFP;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (singletonDocID != -1) {
|
if (singletonDocID != -1) {
|
||||||
out.writeVInt(singletonDocID);
|
out.writeVInt(singletonDocID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue