internal void  WriteProx(FreqProxTermsWriter.PostingList p, int proxCode)
        {
            Payload payload;

            if (payloadAttribute == null)
            {
                payload = null;
            }
            else
            {
                payload = payloadAttribute.Payload;
            }

            if (payload != null && payload.internalLength > 0)
            {
                termsHashPerField.WriteVInt(1, (proxCode << 1) | 1);
                termsHashPerField.WriteVInt(1, payload.internalLength);
                termsHashPerField.WriteBytes(1, payload.data, payload.internalOffset, payload.internalLength);
                hasPayloads = true;
            }
            else
            {
                termsHashPerField.WriteVInt(1, proxCode << 1);
            }
            p.lastPosition = fieldState.position;
        }
Example #2
0
        internal void WriteProx(int termID, int proxCode)
        {
            //System.out.println("writeProx termID=" + termID + " proxCode=" + proxCode);
            Debug.Assert(HasProx);
            BytesRef payload;

            if (PayloadAttribute == null)
            {
                payload = null;
            }
            else
            {
                payload = PayloadAttribute.Payload;
            }

            if (payload != null && payload.Length > 0)
            {
                TermsHashPerField.WriteVInt(1, (proxCode << 1) | 1);
                TermsHashPerField.WriteVInt(1, payload.Length);
                TermsHashPerField.WriteBytes(1, payload.Bytes, payload.Offset, payload.Length);
                HasPayloads = true;
            }
            else
            {
                TermsHashPerField.WriteVInt(1, proxCode << 1);
            }

            FreqProxPostingsArray postings = (FreqProxPostingsArray)TermsHashPerField.PostingsArray;

            postings.LastPositions[termID] = FieldState.Position_Renamed;
        }
Example #3
0
        internal void WriteProx(int termID, int proxCode)
        {
            //System.out.println("writeProx termID=" + termID + " proxCode=" + proxCode);
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(hasProx);
            }
            BytesRef payload;

            if (payloadAttribute is null)
            {
                payload = null;
            }
            else
            {
                payload = payloadAttribute.Payload;
            }

            if (payload != null && payload.Length > 0)
            {
                termsHashPerField.WriteVInt32(1, (proxCode << 1) | 1);
                termsHashPerField.WriteVInt32(1, payload.Length);
                termsHashPerField.WriteBytes(1, payload.Bytes, payload.Offset, payload.Length);
                hasPayloads = true;
            }
            else
            {
                termsHashPerField.WriteVInt32(1, proxCode << 1);
            }

            FreqProxPostingsArray postings = (FreqProxPostingsArray)termsHashPerField.postingsArray;

            postings.lastPositions[termID] = fieldState.Position;
        }