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); }
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 System.ArgumentException("Incompatible DocValues type: field \"" + fieldInfo.Name + "\" changed from " + GetTypeDesc(writer) + " to binary"); } else { binaryWriter = (BinaryDocValuesWriter)writer; } binaryWriter.AddValue(docID, value); }
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 System.ArgumentException("Incompatible DocValues type: field \"" + fieldInfo.Name + "\" changed from " + GetTypeDesc(writer) + " to binary"); } else { binaryWriter = (BinaryDocValuesWriter)writer; } binaryWriter.AddValue(docID, value); }