예제 #1
0
            internal TermsWriter(FSTOrdTermsWriter outerInstance, FieldInfo fieldInfo)
            {
                this.outerInstance = outerInstance;
                this.numTerms      = 0;
                this.fieldInfo     = fieldInfo;
                this.longsSize     = outerInstance.postingsWriter.setField(fieldInfo);
                this.outputs       = PositiveIntOutputs.Singleton;
                this.builder       = new Builder <>(FST.INPUT_TYPE.BYTE1, outputs);

                this.lastBlockStatsFP     = 0;
                this.lastBlockMetaLongsFP = 0;
                this.lastBlockMetaBytesFP = 0;
                this.lastBlockLongs       = new long[longsSize];

                this.lastLongs       = new long[longsSize];
                this.lastMetaBytesFP = 0;
            }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public org.apache.lucene.codecs.FieldsConsumer fieldsConsumer(org.apache.lucene.index.SegmentWriteState state) throws java.io.IOException
        public override FieldsConsumer fieldsConsumer(SegmentWriteState state)
        {
            PostingsWriterBase postingsWriter = new Lucene41PostingsWriter(state);

            bool success = false;

            try
            {
                FieldsConsumer ret = new FSTOrdTermsWriter(state, postingsWriter);
                success = true;
                return(ret);
            }
            finally
            {
                if (!success)
                {
                    IOUtils.closeWhileHandlingException(postingsWriter);
                }
            }
        }