public SimpleTextFieldsReader(SegmentReadState state) { this.maxDoc = state.SegmentInfo.DocCount; fieldInfos = state.FieldInfos; input = state.Directory.OpenInput(SimpleTextPostingsFormat.GetPostingsFileName(state.SegmentInfo.Name, state.SegmentSuffix), state.Context); bool success = false; try { fields = ReadFields((IndexInput)input.Clone()); success = true; } finally { if (!success) { IOUtils.DisposeWhileHandlingException(this); } } }
public SimpleTextFieldsWriter(SegmentWriteState state) { var fileName = SimpleTextPostingsFormat.GetPostingsFileName(state.SegmentInfo.Name, state.SegmentSuffix); _output = state.Directory.CreateOutput(fileName, state.Context); }