23 namespace Lucene.Net.Index
31 internal bool omitTermFreqAndPositions;
32 internal bool storePayloads;
33 internal int lastPayloadLength = - 1;
38 omitTermFreqAndPositions = parent.omitTermFreqAndPositions;
39 if (parent.parent.parent.fieldInfos.HasProx())
44 state.flushedFiles.Add(fileName);
45 out_Renamed = parent.parent.parent.dir.CreateOutput(fileName);
46 parent.skipListWriter.SetProxOutput(out_Renamed);
53 internal int lastPosition;
56 internal override void AddPosition(
int position, byte[] payload,
int payloadOffset,
int payloadLength)
58 System.Diagnostics.Debug.Assert(!omitTermFreqAndPositions,
"omitTermFreqAndPositions is true");
59 System.Diagnostics.Debug.Assert(out_Renamed != null);
61 int delta = position - lastPosition;
62 lastPosition = position;
66 if (payloadLength != lastPayloadLength)
68 lastPayloadLength = payloadLength;
69 out_Renamed.WriteVInt((delta << 1) | 1);
70 out_Renamed.WriteVInt(payloadLength);
73 out_Renamed.WriteVInt(delta << 1);
74 if (payloadLength > 0)
75 out_Renamed.WriteBytes(payload, payloadLength);
78 out_Renamed.WriteVInt(delta);
81 internal void SetField(
FieldInfo fieldInfo)
83 omitTermFreqAndPositions = fieldInfo.omitTermFreqAndPositions;
84 storePayloads = omitTermFreqAndPositions?
false:fieldInfo.storePayloads;
88 internal override void Finish()
91 lastPayloadLength = - 1;
97 if (out_Renamed != null)