Exemplo n.º 1
0
        internal void AddBinaryField(FieldInfo fieldInfo, int docID, BytesRef value)
        {
            BinaryDocValuesWriter binaryWriter;

            if (!writers.TryGetValue(fieldInfo.Name, out DocValuesWriter writer) || writer is null)
            {
                binaryWriter            = new BinaryDocValuesWriter(fieldInfo, bytesUsed);
                writers[fieldInfo.Name] = binaryWriter;
            }
            else if (writer is BinaryDocValuesWriter temp)
            {
                binaryWriter = temp;
            }
            else
            {
                throw new ArgumentException($"Incompatible DocValues type: field \"{fieldInfo.Name}\" changed from {GetTypeDesc(writer)} to binary");
            }
            binaryWriter.AddValue(docID, value);
        }
Exemplo n.º 2
0
        internal void AddBinaryField(FieldInfo fieldInfo, int docID, BytesRef value)
        {
            DocValuesWriter writer;

            writers.TryGetValue(fieldInfo.Name, out writer);
            BinaryDocValuesWriter binaryWriter;

            if (writer == null)
            {
                binaryWriter            = new BinaryDocValuesWriter(fieldInfo, bytesUsed);
                writers[fieldInfo.Name] = binaryWriter;
            }
            else if (!(writer is BinaryDocValuesWriter))
            {
                throw new ArgumentException("Incompatible DocValues type: field \"" + fieldInfo.Name + "\" changed from " + GetTypeDesc(writer) + " to binary");
            }
            else
            {
                binaryWriter = (BinaryDocValuesWriter)writer;
            }
            binaryWriter.AddValue(docID, value);
        }