internal void AddSortedField(FieldInfo fieldInfo, int docID, BytesRef value) { SortedDocValuesWriter sortedWriter; if (!writers.TryGetValue(fieldInfo.Name, out DocValuesWriter writer) || writer is null) { sortedWriter = new SortedDocValuesWriter(fieldInfo, bytesUsed); writers[fieldInfo.Name] = sortedWriter; } else if (writer is SortedDocValuesWriter temp) { sortedWriter = temp; } else { throw new ArgumentException($"Incompatible DocValues type: field \"{fieldInfo.Name}\" changed from {GetTypeDesc(writer)} to sorted"); } sortedWriter.AddValue(docID, value); }
internal void AddSortedField(FieldInfo fieldInfo, int docID, BytesRef value) { DocValuesWriter writer; writers.TryGetValue(fieldInfo.Name, out writer); SortedDocValuesWriter sortedWriter; if (writer == null) { sortedWriter = new SortedDocValuesWriter(fieldInfo, bytesUsed); writers[fieldInfo.Name] = sortedWriter; } else if (!(writer is SortedDocValuesWriter)) { throw new ArgumentException("Incompatible DocValues type: field \"" + fieldInfo.Name + "\" changed from " + GetTypeDesc(writer) + " to sorted"); } else { sortedWriter = (SortedDocValuesWriter)writer; } sortedWriter.AddValue(docID, value); }