Exemplo n.º 1
0
 internal override void Finish()
 {
     if (fieldInfo.IsIndexed && !fieldInfo.OmitsNorms)
     {
         if (consumer == null)
         {
             fieldInfo.NormType = DocValuesType.NUMERIC;
             consumer           = new NumericDocValuesWriter(fieldInfo, docState.docWriter.bytesUsed, false);
         }
         consumer.AddValue(docState.docID, similarity.ComputeNorm(fieldState));
     }
 }
Exemplo n.º 2
0
        internal void AddNumericField(FieldInfo fieldInfo, int docID, long value)
        {
            NumericDocValuesWriter numericWriter;

            if (!writers.TryGetValue(fieldInfo.Name, out DocValuesWriter writer) || writer is null)
            {
                numericWriter           = new NumericDocValuesWriter(fieldInfo, bytesUsed, true);
                writers[fieldInfo.Name] = numericWriter;
            }
            else if (writer is NumericDocValuesWriter temp)
            {
                numericWriter = temp;
            }
            else
            {
                throw new ArgumentException($"Incompatible DocValues type: field \"{fieldInfo.Name}\" changed from {GetTypeDesc(writer)} to numeric");
            }
            numericWriter.AddValue(docID, value);
        }
Exemplo n.º 3
0
        internal void AddNumericField(FieldInfo fieldInfo, int docID, long value)
        {
            DocValuesWriter writer;

            writers.TryGetValue(fieldInfo.Name, out writer);
            NumericDocValuesWriter numericWriter;

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