Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
        public SimpleTextFieldsWriter(SegmentWriteState state)
        {
            var fileName = SimpleTextPostingsFormat.GetPostingsFileName(state.SegmentInfo.Name, state.SegmentSuffix);

            _output = state.Directory.CreateOutput(fileName, state.Context);
        }