Пример #1
0
        public override void StartTerm(BytesRef term, int freq)
        {
            Debug.Assert(freq >= 1);
            int prefix = StringHelper.BytesDifference(LastTerm, term);

            CurField.AddTerm(freq, prefix, term.Length - prefix);
            TermSuffixes.WriteBytes(term.Bytes, term.Offset + prefix, term.Length - prefix);
            // copy last term
            if (LastTerm.Bytes.Length < term.Length)
            {
                LastTerm.Bytes = new byte[ArrayUtil.Oversize(term.Length, 1)];
            }
            LastTerm.Offset = 0;
            LastTerm.Length = term.Length;
            Array.Copy(term.Bytes, term.Offset, LastTerm.Bytes, 0, term.Length);
        }