Ejemplo n.º 1
0
 public SimpleFieldWriter(FieldInfo fieldInfo, long termsFilePointer, FixedGapTermsIndexWriter fgtiw)
 {
     FieldInfo           = fieldInfo;
     IndexStart          = fgtiw.Output.FilePointer;
     TermsStart          = _lastTermsPointer = termsFilePointer;
     _termLengths        = new short[0];
     _termsPointerDeltas = new int[0];
     _fgtiw = fgtiw;
 }
Ejemplo n.º 2
0
            internal SimpleFieldWriter(FixedGapTermsIndexWriter outerInstance, FieldInfo fieldInfo, long termsFilePointer)
            {
                this.outerInstance = outerInstance;

                this.fieldInfo     = fieldInfo;
                indexStart         = outerInstance.m_output.GetFilePointer();
                termsStart         = lastTermsPointer = termsFilePointer;
                termLengths        = EMPTY_INT16S;
                termsPointerDeltas = EMPTY_INT32S;
            }
Ejemplo n.º 3
0
            internal SimpleFieldWriter(FixedGapTermsIndexWriter outerInstance, FieldInfo fieldInfo, long termsFilePointer)
            {
                this.outerInstance = outerInstance;

                this.fieldInfo     = fieldInfo;
                indexStart         = outerInstance.m_output.Position; // LUCENENET specific: Renamed from getFilePointer() to match FileStream
                termsStart         = lastTermsPointer = termsFilePointer;
                termLengths        = EMPTY_INT16S;
                termsPointerDeltas = EMPTY_INT32S;
            }
Ejemplo n.º 4
0
        public override FieldsConsumer FieldsConsumer(SegmentWriteState state)
        {
            PostingsWriterBase docs = new Lucene41PostingsWriter(state);

            // TODO: should we make the terms index more easily
            // pluggable?  Ie so that this codec would record which
            // index impl was used, and switch on loading?
            // Or... you must make a new Codec for this?
            TermsIndexWriterBase indexWriter;
            bool success = false;
            try
            {
                indexWriter = new FixedGapTermsIndexWriter(state);
                success = true;
            }
            finally
            {
                if (!success)
                {
                    docs.Dispose();
                }
            }

            success = false;
            try
            {
                // Must use BlockTermsWriter (not BlockTree) because
                // BlockTree doens't support ords (yet)...
                FieldsConsumer ret = new BlockTermsWriter(indexWriter, state, docs);
                success = true;
                return ret;
            }
            finally
            {
                if (!success)
                {
                    try
                    {
                        docs.Dispose();
                    }
                    finally
                    {
                        indexWriter.Dispose();
                    }
                }
            }
        }
        public override FieldsConsumer FieldsConsumer(SegmentWriteState state)
        {
            PostingsWriterBase postingsWriter = new SepPostingsWriter(state, new MockIntFactory(baseBlockSize));

            bool success = false;
            TermsIndexWriterBase indexWriter;
            try
            {
                indexWriter = new FixedGapTermsIndexWriter(state);
                success = true;
            }
            finally
            {
                if (!success)
                {
                    postingsWriter.Dispose();
                }
            }

            success = false;
            try
            {
                FieldsConsumer ret = new BlockTermsWriter(indexWriter, state, postingsWriter);
                success = true;
                return ret;
            }
            finally
            {
                if (!success)
                {
                    try
                    {
                        postingsWriter.Dispose();
                    }
                    finally
                    {
                        indexWriter.Dispose();
                    }
                }
            }
        }
 public SimpleFieldWriter(FieldInfo fieldInfo, long termsFilePointer, FixedGapTermsIndexWriter fgtiw)
 {
     FieldInfo = fieldInfo;
     IndexStart = fgtiw.Output.FilePointer;
     TermsStart = _lastTermsPointer = termsFilePointer;
     _termLengths = new short[0];
     _termsPointerDeltas = new int[0];
     _fgtiw = fgtiw;
 }