internal void writeProx(Token t, FreqProxTermsWriter.PostingList p, int proxCode)
        {
            Payload payload = t.GetPayload();

            if (payload != null && payload.length > 0)
            {
                termsHashPerField.writeVInt(1, (proxCode << 1) | 1);
                termsHashPerField.writeVInt(1, payload.length);
                termsHashPerField.writeBytes(1, payload.data, payload.offset, payload.length);
                hasPayloads = true;
            }
            else
            {
                termsHashPerField.writeVInt(1, proxCode << 1);
            }
            p.lastPosition = fieldState.position;
        }
Beispiel #2
0
        internal override void newTerm(Token t, RawPostingList p0)
        {
            System.Diagnostics.Debug.Assert(docState.TestPoint("TermVectorsTermsWriterPerField.newTerm start"));

            TermVectorsTermsWriter.PostingList p = (TermVectorsTermsWriter.PostingList)p0;

            p.freq = 1;

            if (doVectorOffsets)
            {
                int startOffset = fieldState.offset + t.StartOffset();
                int endOffset   = fieldState.offset + t.EndOffset();
                termsHashPerField.writeVInt(1, startOffset);
                termsHashPerField.writeVInt(1, endOffset - startOffset);
                p.lastOffset = endOffset;
            }

            if (doVectorPositions)
            {
                termsHashPerField.writeVInt(0, fieldState.position);
                p.lastPosition = fieldState.position;
            }
        }