예제 #1
0
        public override void Flush(SegmentWriteState state)
        {
            IDictionary <string, DocFieldConsumerPerField> childFields = new Dictionary <string, DocFieldConsumerPerField>();
            ICollection <DocFieldConsumerPerField>         fields      = Fields();

            foreach (DocFieldConsumerPerField f in fields)
            {
                childFields[f.FieldInfo.Name] = f;
            }

            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(fields.Count == totalFieldCount);
            }

            storedConsumer.Flush(state);
            consumer.Flush(childFields, state);

            // Important to save after asking consumer to flush so
            // consumer can alter the FieldInfo* if necessary.  EG,
            // FreqProxTermsWriter does this with
            // FieldInfo.storePayload.
            FieldInfosWriter infosWriter = codec.FieldInfosFormat.FieldInfosWriter;

            infosWriter.Write(state.Directory, state.SegmentInfo.Name, "", state.FieldInfos, IOContext.DEFAULT);
        }
예제 #2
0
 public override void Flush(SegmentWriteState state) // LUCENENET NOTE: original was internal, but other implementations require public
 {
     first.Flush(state);
     second.Flush(state);
 }