コード例 #1
0
ファイル: DocValuesProcessor.cs プロジェクト: YAFNET/YAFNET
        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);
        }
コード例 #2
0
        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);
        }