internal FieldsReader(PerFieldDocValuesFormat outerInstance, FieldsReader other) { this.outerInstance = outerInstance; IDictionary <DocValuesProducer, DocValuesProducer> oldToNew = new JCG.Dictionary <DocValuesProducer, DocValuesProducer>(IdentityEqualityComparer <DocValuesProducer> .Default); // First clone all formats foreach (KeyValuePair <string, DocValuesProducer> ent in other.formats) { DocValuesProducer values = ent.Value; formats[ent.Key] = values; oldToNew[ent.Value] = values; } // Then rebuild fields: foreach (KeyValuePair <string, DocValuesProducer> ent in other.fields) { DocValuesProducer producer; oldToNew.TryGetValue(ent.Value, out producer); if (Debugging.AssertsEnabled) { Debugging.Assert(producer != null); } fields[ent.Key] = producer; } }
internal FieldsReader(PerFieldDocValuesFormat outerInstance, FieldsReader other) { this.OuterInstance = outerInstance; IDictionary <DocValuesProducer, DocValuesProducer> oldToNew = new HashMap <DocValuesProducer, DocValuesProducer>(); // First clone all formats foreach (KeyValuePair <string, DocValuesProducer> ent in other.Formats) { DocValuesProducer values = ent.Value; Formats[ent.Key] = values; oldToNew[ent.Value] = values; } // Then rebuild fields: foreach (KeyValuePair <string, DocValuesProducer> ent in other.Fields) { DocValuesProducer producer = oldToNew[ent.Value]; Debug.Assert(producer != null); Fields[ent.Key] = producer; } }
public override void CheckIntegrity() { EnsureOpen(); // stored fields FieldsReader.CheckIntegrity(); // term vectors TermVectorsReader termVectorsReader = TermVectorsReader; if (termVectorsReader != null) { termVectorsReader.CheckIntegrity(); } // terms/postings if (core.fields != null) { core.fields.CheckIntegrity(); } // norms if (core.normsProducer != null) { core.normsProducer.CheckIntegrity(); } // docvalues if (dvProducers != null) { foreach (DocValuesProducer producer in dvProducers) { producer.CheckIntegrity(); } } }
internal FieldsReader(PerFieldDocValuesFormat outerInstance, FieldsReader other) { this.OuterInstance = outerInstance; IDictionary<DocValuesProducer, DocValuesProducer> oldToNew = new HashMap<DocValuesProducer, DocValuesProducer>(); // First clone all formats foreach (KeyValuePair<string, DocValuesProducer> ent in other.Formats) { DocValuesProducer values = ent.Value; Formats[ent.Key] = values; oldToNew[ent.Value] = values; } // Then rebuild fields: foreach (KeyValuePair<string, DocValuesProducer> ent in other.Fields) { DocValuesProducer producer = oldToNew[ent.Value]; Debug.Assert(producer != null); Fields[ent.Key] = producer; } }