Buffers up pending byte[] per doc, then flushes when segment flushes.
Inheritance: Lucene.Net.Index.DocValuesWriter
コード例 #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);
        }
コード例 #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 System.ArgumentException("Incompatible DocValues type: field \"" + fieldInfo.Name + "\" changed from " + GetTypeDesc(writer) + " to binary");
            }
            else
            {
                binaryWriter = (BinaryDocValuesWriter)writer;
            }
            binaryWriter.AddValue(docID, value);
        }
コード例 #3
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 System.ArgumentException("Incompatible DocValues type: field \"" + fieldInfo.Name + "\" changed from " + GetTypeDesc(writer) + " to binary");
     }
     else
     {
         binaryWriter = (BinaryDocValuesWriter)writer;
     }
     binaryWriter.AddValue(docID, value);
 }