• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Store.IndexInput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Lucene.Net.Store.IndexInput的典型用法代码示例。如果您正苦于以下问题:C# Lucene.Net.Store.IndexInput类的具体用法?C# Lucene.Net.Store.IndexInput怎么用?C# Lucene.Net.Store.IndexInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Lucene.Net.Store.IndexInput类属于命名空间,在下文中一共展示了Lucene.Net.Store.IndexInput类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Read

 public void Read(IndexInput input, FieldInfos fieldInfos)
 {
     this.Term = null; // invalidate cache
     NewSuffixStart = input.ReadVInt();
     int length = input.ReadVInt();
     int totalLength = NewSuffixStart + length;
     Debug.Assert(totalLength <= ByteBlockPool.BYTE_BLOCK_SIZE - 2, "termLength=" + totalLength + ",resource=" + input);
     if (Bytes.Bytes.Length < totalLength)
     {
         Bytes.Grow(totalLength);
     }
     Bytes.Length = totalLength;
     input.ReadBytes(Bytes.Bytes, NewSuffixStart, length);
     int fieldNumber = input.ReadVInt();
     if (fieldNumber != CurrentFieldNumber)
     {
         CurrentFieldNumber = fieldNumber;
         // NOTE: too much sneakiness here, seriously this is a negative vint?!
         if (CurrentFieldNumber == -1)
         {
             Field = "";
         }
         else
         {
             Debug.Assert(fieldInfos.FieldInfo(CurrentFieldNumber) != null, CurrentFieldNumber.ToString());
             Field = String.Intern(fieldInfos.FieldInfo(CurrentFieldNumber).Name);
         }
     }
     else
     {
         Debug.Assert(Field.Equals(fieldInfos.FieldInfo(fieldNumber).Name), "currentFieldNumber=" + CurrentFieldNumber + " field=" + Field + " vs " + fieldInfos.FieldInfo(fieldNumber) == null ? "null" : fieldInfos.FieldInfo(fieldNumber).Name);
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:33,代码来源:TermBuffer.cs


示例2: Read

        public void Read(IndexInput input, FieldInfos fieldInfos)
        {
            this.term = null; // invalidate cache
            int start = input.ReadVInt();
            int length = input.ReadVInt();
            int totalLength = start + length;
            if (preUTF8Strings)
            {
                text.SetLength(totalLength);
                input.ReadChars(text.result, start, length);
            }
            else
            {

                if (dirty)
                {
                    // Fully convert all bytes since bytes is dirty
                    UnicodeUtil.UTF16toUTF8(text.result, 0, text.length, bytes);
                    bytes.SetLength(totalLength);
                    input.ReadBytes(bytes.result, start, length);
                    UnicodeUtil.UTF8toUTF16(bytes.result, 0, totalLength, text);
                    dirty = false;
                }
                else
                {
                    // Incrementally convert only the UTF8 bytes that are new:
                    bytes.SetLength(totalLength);
                    input.ReadBytes(bytes.result, start, length);
                    UnicodeUtil.UTF8toUTF16(bytes.result, start, length, text);
                }
            }
            this.field = fieldInfos.FieldName(input.ReadVInt());
        }
开发者ID:sinsay,项目名称:SSE,代码行数:33,代码来源:TermBuffer.cs


示例3: SegmentTermDocs

		public SegmentTermDocs(SegmentReader parent)
		{
			this.parent = parent;
			this.freqStream = (IndexInput) parent.freqStream.Clone();
			this.deletedDocs = parent.deletedDocs;
			this.skipInterval = parent.tis.GetSkipInterval();
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:7,代码来源:SegmentTermDocs.cs


示例4: SegmentTermEnum

        internal SegmentTermEnum(IndexInput i, FieldInfos fis, bool isi)
        {
            input = i;
            fieldInfos = fis;
            isIndex = isi;
            maxSkipLevels = 1; // use single-level skip lists for formats > -3

            int firstInt = input.ReadInt();
            if (firstInt >= 0)
            {
                // original-format file, without explicit format version number
                format = 0;
                size = firstInt;

                // back-compatible settings
                indexInterval = 128;
                skipInterval = System.Int32.MaxValue; // switch off skipTo optimization
            }
            else
            {
                // we have a format version number
                format = firstInt;

                // check that it is a format we can understand
                if (format < TermInfosWriter.FORMAT_CURRENT)
                    throw new CorruptIndexException("Unknown format version:" + format + " expected " + TermInfosWriter.FORMAT_CURRENT + " or higher");

                size = input.ReadLong(); // read the size

                if (format == - 1)
                {
                    if (!isIndex)
                    {
                        indexInterval = input.ReadInt();
                        formatM1SkipInterval = input.ReadInt();
                    }
                    // switch off skipTo optimization for file format prior to 1.4rc2 in order to avoid a bug in
                    // skipTo implementation of these versions
                    skipInterval = System.Int32.MaxValue;
                }
                else
                {
                    indexInterval = input.ReadInt();
                    skipInterval = input.ReadInt();
                    if (format <= TermInfosWriter.FORMAT)
                    {
                        // this new format introduces multi-level skipping
                        maxSkipLevels = input.ReadInt();
                    }
                }
                System.Diagnostics.Debug.Assert(indexInterval > 0, "indexInterval=" + indexInterval + " is negative; must be > 0");
                System.Diagnostics.Debug.Assert(skipInterval > 0, "skipInterval=" + skipInterval + " is negative; must be > 0");
            }
            if (format > TermInfosWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES)
            {
                termBuffer.SetPreUTF8Strings();
                scanBuffer.SetPreUTF8Strings();
                prevBuffer.SetPreUTF8Strings();
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:60,代码来源:SegmentTermEnum.cs


示例5: DefaultSkipListReader

 internal DefaultSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval)
     : base(skipStream, maxSkipLevels, skipInterval)
 {
     freqPointer = new long[maxSkipLevels];
     proxPointer = new long[maxSkipLevels];
     payloadLength = new int[maxSkipLevels];
 }
开发者ID:sinsay,项目名称:SSE,代码行数:7,代码来源:DefaultSkipListReader.cs


示例6: Norm

			public Norm(SegmentReader enclosingInstance, IndexInput in_Renamed, int number, long normSeek)
			{
				InitBlock(enclosingInstance);
				this.in_Renamed = in_Renamed;
				this.number = number;
				this.normSeek = normSeek;
			}
开发者ID:zweib730,项目名称:beagrep,代码行数:7,代码来源:SegmentReader.cs


示例7: Lucene41SkipReader

 public Lucene41SkipReader(IndexInput skipStream, int maxSkipLevels, int blockSize, bool hasPos, bool hasOffsets, bool hasPayloads)
     : base(skipStream, maxSkipLevels, blockSize, 8)
 {
     this.BlockSize = blockSize;
     DocPointer_Renamed = new long[maxSkipLevels];
     if (hasPos)
     {
         PosPointer_Renamed = new long[maxSkipLevels];
         PosBufferUpto_Renamed = new int[maxSkipLevels];
         if (hasPayloads)
         {
             PayloadByteUpto_Renamed = new int[maxSkipLevels];
         }
         else
         {
             PayloadByteUpto_Renamed = null;
         }
         if (hasOffsets || hasPayloads)
         {
             PayPointer_Renamed = new long[maxSkipLevels];
         }
         else
         {
             PayPointer_Renamed = null;
         }
     }
     else
     {
         PosPointer_Renamed = null;
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:31,代码来源:Lucene41SkipReader.cs


示例8: Lucene3xSkipListReader

 public Lucene3xSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval)
     : base(skipStream, maxSkipLevels, skipInterval)
 {
     FreqPointer_Renamed = new long[maxSkipLevels];
     ProxPointer_Renamed = new long[maxSkipLevels];
     PayloadLength_Renamed = new int[maxSkipLevels];
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:Lucene3xSkipListReader.cs


示例9: SegmentTermDocs

 public SegmentTermDocs(IndexInput freqStream, TermInfosReader tis, FieldInfos fieldInfos)
 {
     this.FreqStream = (IndexInput)freqStream.Clone();
     this.Tis = tis;
     this.FieldInfos = fieldInfos;
     SkipInterval = tis.SkipInterval;
     MaxSkipLevels = tis.MaxSkipLevels;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:8,代码来源:SegmentTermDocs.cs


示例10: DirectPacked64SingleBlockReader

 internal DirectPacked64SingleBlockReader(int bitsPerValue, int valueCount, IndexInput @in)
     : base(valueCount, bitsPerValue)
 {
     [email protected] = @in;
     StartPointer = @in.FilePointer;
     ValuesPerBlock = 64 / bitsPerValue;
     Mask = ~(~0L << bitsPerValue);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:8,代码来源:DirectPacked64SingleBlockReader.cs


示例11: CheckValidFormat

		private int CheckValidFormat(IndexInput in_Renamed)
		{
			int format = in_Renamed.ReadInt();
			if (format > TermVectorsWriter.FORMAT_VERSION)
			{
				throw new System.IO.IOException("Incompatible format version: " + format + " expected " + TermVectorsWriter.FORMAT_VERSION + " or less");
			}
			return format;
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:9,代码来源:TermVectorsReader.cs


示例12: Read

		public void  Read(IndexInput input, FieldInfos fieldInfos)
		{
			this.term = null; // invalidate cache
			int start = input.ReadVInt();
			int length = input.ReadVInt();
			int totalLength = start + length;
			SetTextLength(totalLength);
			input.ReadChars(this.text, start, length);
			this.field = fieldInfos.FieldName(input.ReadVInt());
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:10,代码来源:TermBuffer.cs


示例13: SegmentTermDocs

		public /*protected internal*/ SegmentTermDocs(SegmentReader parent)
		{
			this.parent = parent;
			this.freqStream = (IndexInput) parent.core.freqStream.Clone();
			lock (parent)
			{
				this.deletedDocs = parent.deletedDocs;
			}
			this.skipInterval = parent.core.GetTermsReader().GetSkipInterval();
			this.maxSkipLevels = parent.core.GetTermsReader().GetMaxSkipLevels();
		}
开发者ID:jhuntsman,项目名称:FlexNet,代码行数:11,代码来源:SegmentTermDocs.cs


示例14: SegmentTermDocs

 /*protected internal*/
 public SegmentTermDocs(SegmentReader parent)
 {
     this.parent = parent;
     this.freqStream = (IndexInput) parent.core.freqStream.Clone();
     lock (parent)
     {
         this.deletedDocs = parent.deletedDocs;
     }
     this.skipInterval = parent.core.GetTermsReader().SkipInterval;
     this.maxSkipLevels = parent.core.GetTermsReader().MaxSkipLevels;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:SegmentTermDocs.cs


示例15: FieldsReader

		// Used only by clone
		private FieldsReader(FieldInfos fieldInfos, int numTotalDocs, int size, int format, int formatSize, int docStoreOffset, IndexInput cloneableFieldsStream, IndexInput cloneableIndexStream)
		{
			this.fieldInfos = fieldInfos;
			this.numTotalDocs = numTotalDocs;
			this.size = size;
			this.format = format;
			this.formatSize = formatSize;
			this.docStoreOffset = docStoreOffset;
			this.cloneableFieldsStream = cloneableFieldsStream;
			this.cloneableIndexStream = cloneableIndexStream;
			fieldsStream = (IndexInput) cloneableFieldsStream.Clone();
			indexStream = (IndexInput) cloneableIndexStream.Clone();
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:14,代码来源:FieldsReader.cs


示例16: DirectPackedReader

        public DirectPackedReader(int bitsPerValue, int valueCount, IndexInput @in)
            : base(valueCount, bitsPerValue)
        {
            [email protected] = @in;

            StartPointer = @in.FilePointer;
            if (bitsPerValue == 64)
            {
                ValueMask = -1L;
            }
            else
            {
                ValueMask = (1L << bitsPerValue) - 1;
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:15,代码来源:DirectPackedReader.cs


示例17: SegmentTermEnum

		internal SegmentTermEnum(IndexInput i, FieldInfos fis, bool isi)
		{
			input = i;
			fieldInfos = fis;
			isIndex = isi;
			
			int firstInt = input.ReadInt();
			if (firstInt >= 0)
			{
				// original-format file, without explicit format version number
				format = 0;
				size = firstInt;
				
				// back-compatible settings
				indexInterval = 128;
				skipInterval = System.Int32.MaxValue; // switch off skipTo optimization
			}
			else
			{
				// we have a format version number
				format = firstInt;
				
				// check that it is a format we can understand
				if (format < TermInfosWriter.FORMAT)
					throw new System.IO.IOException("Unknown format version:" + format);
				
				size = input.ReadLong(); // read the size
				
				if (format == - 1)
				{
					if (!isIndex)
					{
						indexInterval = input.ReadInt();
						formatM1SkipInterval = input.ReadInt();
					}
					// switch off skipTo optimization for file format prior to 1.4rc2 in order to avoid a bug in 
					// skipTo implementation of these versions
					skipInterval = System.Int32.MaxValue;
				}
				else
				{
					indexInterval = input.ReadInt();
					skipInterval = input.ReadInt();
				}
			}
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:46,代码来源:SegmentTermEnum.cs


示例18: MultiLevelSkipListReader

        private IndexInput[] skipStream; // skipStream for each level

        #endregion Fields

        #region Constructors

        public MultiLevelSkipListReader(IndexInput skipStream, int maxSkipLevels, int skipInterval)
        {
            this.skipStream = new IndexInput[maxSkipLevels];
            this.skipPointer = new long[maxSkipLevels];
            this.childPointer = new long[maxSkipLevels];
            this.numSkipped = new int[maxSkipLevels];
            this.maxNumberOfSkipLevels = maxSkipLevels;
            this.skipInterval = new int[maxSkipLevels];
            this.skipStream[0] = skipStream;
            this.inputIsBuffered = (skipStream is BufferedIndexInput);
            this.skipInterval[0] = skipInterval;
            for (int i = 1; i < maxSkipLevels; i++)
            {
                // cache skip intervals
                this.skipInterval[i] = this.skipInterval[i - 1] * skipInterval;
            }
            skipDoc = new int[maxSkipLevels];
        }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:24,代码来源:MultiLevelSkipListReader.cs


示例19: FieldsReader

		internal FieldsReader(Directory d, System.String segment, FieldInfos fn, int readBufferSize, int docStoreOffset, int size)
		{
			bool success = false;
			
			try
			{
				fieldInfos = fn;
				
				cloneableFieldsStream = d.OpenInput(segment + ".fdt", readBufferSize);
				fieldsStream = (IndexInput) cloneableFieldsStream.Clone();
				indexStream = d.OpenInput(segment + ".fdx", readBufferSize);
				
				if (docStoreOffset != - 1)
				{
					// We read only a slice out of this shared fields file
					this.docStoreOffset = docStoreOffset;
					this.size = size;
					
					// Verify the file is long enough to hold all of our
					// docs
					System.Diagnostics.Debug.Assert(((int)(indexStream.Length() / 8)) >= size + this.docStoreOffset);
				}
				else
				{
					this.docStoreOffset = 0;
					this.size = (int) (indexStream.Length() >> 3);
				}
				
				numTotalDocs = (int) (indexStream.Length() >> 3);
				success = true;
			}
			finally
			{
				// With lock-less commits, it's entirely possible (and
				// fine) to hit a FileNotFound exception above. In
				// this case, we want to explicitly close any subset
				// of things that were opened so that we don't have to
				// wait for a GC to do so.
				if (!success)
				{
					Close();
				}
			}
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:44,代码来源:FieldsReader.cs


示例20: FieldsReader

        internal FieldsReader(Directory d, System.String segment, FieldInfos fn, int readBufferSize, int docStoreOffset, int size)
        {
            bool success = false;
            isOriginal = true;
            try
            {
                fieldInfos = fn;

                cloneableFieldsStream = d.OpenInput(segment + "." + IndexFileNames.FIELDS_EXTENSION, readBufferSize);
                cloneableIndexStream = d.OpenInput(segment + "." + IndexFileNames.FIELDS_INDEX_EXTENSION, readBufferSize);

                // First version of fdx did not include a format
                // header, but, the first int will always be 0 in that
                // case
                int firstInt = cloneableIndexStream.ReadInt();
                format = firstInt == 0 ? 0 : firstInt;

                if (format > FieldsWriter.FORMAT_CURRENT)
                    throw new CorruptIndexException("Incompatible format version: " + format + " expected " + FieldsWriter.FORMAT_CURRENT + " or lower");

                formatSize = format > FieldsWriter.FORMAT ? 4 : 0;

                if (format < FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES)
                    cloneableFieldsStream.SetModifiedUTF8StringsMode();

                fieldsStream = (IndexInput) cloneableFieldsStream.Clone();

                long indexSize = cloneableIndexStream.Length() - formatSize;

                if (docStoreOffset != - 1)
                {
                    // We read only a slice out of this shared fields file
                    this.docStoreOffset = docStoreOffset;
                    this.size = size;

                    // Verify the file is long enough to hold all of our
                    // docs
                    System.Diagnostics.Debug.Assert(((int)(indexSize / 8)) >= size + this.docStoreOffset, "indexSize=" + indexSize + " size=" + size + " docStoreOffset=" + docStoreOffset);
                }
                else
                {
                    this.docStoreOffset = 0;
                    this.size = (int) (indexSize >> 3);
                }

                indexStream = (IndexInput) cloneableIndexStream.Clone();
                numTotalDocs = (int) (indexSize >> 3);
                success = true;
            }
            finally
            {
                // With lock-less commits, it's entirely possible (and
                // fine) to hit a FileNotFound exception above. In
                // this case, we want to explicitly close any subset
                // of things that were opened so that we don't have to
                // wait for a GC to do so.
                if (!success)
                {
                    Dispose();
                }
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:62,代码来源:FieldsReader.cs



注:本文中的Lucene.Net.Store.IndexInput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Store.IndexOutput类代码示例发布时间:2022-05-24
下一篇:
C# Store.Directory类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap