Пример #1
0
 internal TermsReader(FSTTermsReader outerInstance, FieldInfo fieldInfo, IndexInput @in, long numTerms, long sumTotalTermFreq, long sumDocFreq, int docCount, int longsSize)
 {
     this.outerInstance    = outerInstance;
     this.fieldInfo        = fieldInfo;
     this.numTerms         = numTerms;
     this.sumTotalTermFreq = sumTotalTermFreq;
     this.sumDocFreq       = sumDocFreq;
     this.docCount         = docCount;
     this.longsSize        = longsSize;
     this.dict             = new FST <FSTTermOutputs.TermData>(@in, new FSTTermOutputs(fieldInfo, longsSize));
 }
Пример #2
0
        public override FieldsProducer FieldsProducer(SegmentReadState state)
        {
            PostingsReaderBase postingsReader = new Lucene41PostingsReader(state.Directory, state.FieldInfos,
                                                                           state.SegmentInfo, state.Context, state.SegmentSuffix);
            bool success = false;

            try
            {
                FieldsProducer ret = new FSTTermsReader(state, postingsReader);
                success = true;
                return(ret);
            }
            finally
            {
                if (!success)
                {
                    IOUtils.DisposeWhileHandlingException(postingsReader);
                }
            }
        }
Пример #3
0
        public override FieldsProducer FieldsProducer(SegmentReadState state)
        {
            PostingsReaderBase docsReader    = null;
            PostingsReaderBase pulsingReader = null;
            bool success = false;

            try
            {
                docsReader    = _wrappedPostingsBaseFormat.PostingsReaderBase(state);
                pulsingReader = new PulsingPostingsReader(state, docsReader);
                FieldsProducer ret = new FSTTermsReader(state, pulsingReader);
                success = true;
                return(ret);
            }
            finally
            {
                if (!success)
                {
                    IOUtils.DisposeWhileHandlingException(docsReader, pulsingReader);
                }
            }
        }