示例#1
0
        internal void AddSortedSetField(FieldInfo fieldInfo, int docID, BytesRef value)
        {
            SortedSetDocValuesWriter sortedSetWriter;

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

            writers.TryGetValue(fieldInfo.Name, out writer);
            SortedSetDocValuesWriter sortedSetWriter;

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