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

C# Store.IndexOutput类代码示例

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

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



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

示例1: FieldsWriter

		internal FieldsWriter(IndexOutput fdx, IndexOutput fdt, FieldInfos fn)
		{
			fieldInfos = fn;
			fieldsStream = fdt;
			indexStream = fdx;
			doClose = false;
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:7,代码来源:FieldsWriter.cs


示例2: DefaultSkipListWriter

		internal DefaultSkipListWriter(int skipInterval, int numberOfSkipLevels, int docCount, IndexOutput freqOutput, IndexOutput proxOutput):base(skipInterval, numberOfSkipLevels, docCount)
		{
			this.freqOutput = freqOutput;
			this.proxOutput = proxOutput;
			
			lastSkipDoc = new int[numberOfSkipLevels];
			lastSkipPayloadLength = new int[numberOfSkipLevels];
			lastSkipFreqPointer = new long[numberOfSkipLevels];
			lastSkipProxPointer = new long[numberOfSkipLevels];
		}
开发者ID:Rationalle,项目名称:ravendb,代码行数:10,代码来源:DefaultSkipListWriter.cs


示例3: ThrottledIndexOutput

 public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput @delegate)
 {
     Debug.Assert(bytesPerSecond > 0);
     [email protected] = @delegate;
     this.BytesPerSecond = bytesPerSecond;
     this.FlushDelayMillis = flushDelayMillis;
     this.CloseDelayMillis = closeDelayMillis;
     this.SeekDelayMillis = seekDelayMillis;
     this.MinBytesWritten = minBytesWritten;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:ThrottledIndexOutput.cs


示例4: PreFlexRWSkipListWriter

        public PreFlexRWSkipListWriter(int skipInterval, int numberOfSkipLevels, int docCount, IndexOutput freqOutput, IndexOutput proxOutput)
            : base(skipInterval, numberOfSkipLevels, docCount)
        {
            this.FreqOutput = freqOutput;
            this.ProxOutput = proxOutput;

            LastSkipDoc = new int[numberOfSkipLevels];
            LastSkipPayloadLength = new int[numberOfSkipLevels];
            LastSkipFreqPointer = new long[numberOfSkipLevels];
            LastSkipProxPointer = new long[numberOfSkipLevels];
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:11,代码来源:PreFlexRWSkipListWriter.cs


示例5: WriteSkipData

		protected internal override void  WriteSkipData(int level, IndexOutput skipBuffer)
		{
			// To efficiently store payloads in the posting lists we do not store the length of
			// every payload. Instead we omit the length for a payload if the previous payload had
			// the same length.
			// However, in order to support skipping the payload length at every skip point must be known.
			// So we use the same length encoding that we use for the posting lists for the skip data as well:
			// Case 1: current field does not store payloads
			//           SkipDatum                 --> DocSkip, FreqSkip, ProxSkip
			//           DocSkip,FreqSkip,ProxSkip --> VInt
			//           DocSkip records the document number before every SkipInterval th  document in TermFreqs. 
			//           Document numbers are represented as differences from the previous value in the sequence.
			// Case 2: current field stores payloads
			//           SkipDatum                 --> DocSkip, PayloadLength?, FreqSkip,ProxSkip
			//           DocSkip,FreqSkip,ProxSkip --> VInt
			//           PayloadLength             --> VInt    
			//         In this case DocSkip/2 is the difference between
			//         the current and the previous value. If DocSkip
			//         is odd, then a PayloadLength encoded as VInt follows,
			//         if DocSkip is even, then it is assumed that the
			//         current payload length equals the length at the previous
			//         skip point
			if (curStorePayloads)
			{
				int delta = curDoc - lastSkipDoc[level];
				if (curPayloadLength == lastSkipPayloadLength[level])
				{
					// the current payload length equals the length at the previous skip point,
					// so we don't store the length again
					skipBuffer.WriteVInt(delta * 2);
				}
				else
				{
					// the payload length is different from the previous one. We shift the DocSkip, 
					// set the lowest bit and store the current payload length as VInt.
					skipBuffer.WriteVInt(delta * 2 + 1);
					skipBuffer.WriteVInt(curPayloadLength);
					lastSkipPayloadLength[level] = curPayloadLength;
				}
			}
			else
			{
				// current field does not store payloads
				skipBuffer.WriteVInt(curDoc - lastSkipDoc[level]);
			}
			skipBuffer.WriteVInt((int) (curFreqPointer - lastSkipFreqPointer[level]));
			skipBuffer.WriteVInt((int) (curProxPointer - lastSkipProxPointer[level]));
			
			lastSkipDoc[level] = curDoc;
			//System.out.println("write doc at level " + level + ": " + curDoc);
			
			lastSkipFreqPointer[level] = curFreqPointer;
			lastSkipProxPointer[level] = curProxPointer;
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:54,代码来源:DefaultSkipListWriter.cs


示例6: Lucene41SkipWriter

        public Lucene41SkipWriter(int maxSkipLevels, int blockSize, int docCount, IndexOutput docOut, IndexOutput posOut, IndexOutput payOut)
            : base(blockSize, 8, maxSkipLevels, docCount)
        {
            this.DocOut = docOut;
            this.PosOut = posOut;
            this.PayOut = payOut;

            LastSkipDoc = new int[maxSkipLevels];
            LastSkipDocPointer = new long[maxSkipLevels];
            if (posOut != null)
            {
                LastSkipPosPointer = new long[maxSkipLevels];
                if (payOut != null)
                {
                    LastSkipPayPointer = new long[maxSkipLevels];
                }
                LastPayloadByteUpto = new int[maxSkipLevels];
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:19,代码来源:Lucene41SkipWriter.cs


示例7: WriteTo

 public long WriteTo(IndexOutput @out)
 {
     long size = 0;
     while (true)
     {
         if (limit + bufferOffset == endIndex)
         {
             System.Diagnostics.Debug.Assert(endIndex - bufferOffset >= upto);
             @out.WriteBytes(buffer, upto, limit - upto);
             size += limit - upto;
             break;
         }
         else
         {
             @out.WriteBytes(buffer, upto, limit - upto);
             size += limit - upto;
             NextSlice();
         }
     }
     
     return size;
 }
开发者ID:Nangal,项目名称:lucene.net,代码行数:22,代码来源:ByteSliceReader.cs


示例8: PreFlexRWNormsConsumer

        private int LastFieldNumber = -1; // only for assert

        #endregion Fields

        #region Constructors

        public PreFlexRWNormsConsumer(Directory directory, string segment, IOContext context)
        {
            string normsFileName = IndexFileNames.SegmentFileName(segment, "", NORMS_EXTENSION);
            bool success = false;
            IndexOutput output = null;
            try
            {
                output = directory.CreateOutput(normsFileName, context);
                // output.WriteBytes(NORMS_HEADER, 0, NORMS_HEADER.Length);
                foreach (var @sbyte in NORMS_HEADER)
                {
                    output.WriteByte((byte)@sbyte);
                }
                @out = output;
                success = true;
            }
            finally
            {
                if (!success)
                {
                    IOUtils.CloseWhileHandlingException(output);
                }
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:30,代码来源:PreFlexRWNormsConsumer.cs


示例9: CopyFile

        /// <summary>Copy the contents of the file with specified extension into the
        /// provided output stream. Use the provided buffer for moving data
        /// to reduce memory allocation.
        /// </summary>
        private void CopyFile(FileEntry source, IndexOutput os, byte[] buffer)
        {
            IndexInput is_Renamed = null;
            try
            {
                long startPtr = os.GetFilePointer();

                is_Renamed = directory.OpenInput(source.file);
                long length = is_Renamed.Length();
                long remainder = length;
                int chunk = buffer.Length;

                while (remainder > 0)
                {
                    int len = (int) System.Math.Min(chunk, remainder);
                    is_Renamed.ReadBytes(buffer, 0, len, false);
                    os.WriteBytes(buffer, len);
                    remainder -= len;
                    if (checkAbort != null)
                    // Roughly every 2 MB we will check if
                    // it's time to abort
                        checkAbort.Work(80);
                }

                // Verify that remainder is 0
                if (remainder != 0)
                    throw new System.IO.IOException("Non-zero remainder length after copying: " + remainder + " (id: " + source.file + ", length: " + length + ", buffer size: " + chunk + ")");

                // Verify that the output length diff is equal to original file
                long endPtr = os.GetFilePointer();
                long diff = endPtr - startPtr;
                if (diff != length)
                    throw new System.IO.IOException("Difference in the output file offsets " + diff + " does not match the original file length " + length);
            }
            finally
            {
                if (is_Renamed != null)
                    is_Renamed.Close();
            }
        }
开发者ID:sinsay,项目名称:SSE,代码行数:44,代码来源:CompoundFileWriter.cs


示例10: Init

 /// <summary>
 /// Called once after startup, before any terms have been
 ///  added.  Implementations typically write a header to
 ///  the provided {@code termsOut}.
 /// </summary>
 public abstract void Init(IndexOutput termsOut);
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:6,代码来源:PostingsWriterBase.cs


示例11: WriteSkip

		/// <summary> Writes the buffered skip lists to the given output.
		/// 
		/// </summary>
		/// <param name="output">the IndexOutput the skip lists shall be written to 
		/// </param>
		/// <returns> the pointer the skip list starts
		/// </returns>
		internal virtual long WriteSkip(IndexOutput output)
		{
			long skipPointer = output.FilePointer;
			if (skipBuffer == null || skipBuffer.Length == 0)
				return skipPointer;
			
			for (int level = numberOfSkipLevels - 1; level > 0; level--)
			{
				long length = skipBuffer[level].FilePointer;
				if (length > 0)
				{
					output.WriteVLong(length);
					skipBuffer[level].WriteTo(output);
				}
			}
			skipBuffer[0].WriteTo(output);
			
			return skipPointer;
		}
开发者ID:modulexcite,项目名称:Xamarin-Lucene.Net,代码行数:26,代码来源:MultiLevelSkipListWriter.cs


示例12: WriteSkipData

		/// <summary> Subclasses must implement the actual skip data encoding in this method.
		/// 
		/// </summary>
		/// <param name="level">the level skip data shall be writting for
		/// </param>
		/// <param name="skipBuffer">the skip buffer to write to
		/// </param>
		protected internal abstract void  WriteSkipData(int level, IndexOutput skipBuffer);
开发者ID:modulexcite,项目名称:Xamarin-Lucene.Net,代码行数:8,代码来源:MultiLevelSkipListWriter.cs


示例13: Write

		public void  Write(IndexOutput output)
		{
			output.WriteVInt(CURRENT_FORMAT);
			output.WriteVInt(Size());
			for (int i = 0; i < Size(); i++)
			{
				FieldInfo fi = FieldInfo(i);
				byte bits = (byte) (0x0);
				if (fi.isIndexed)
					bits |= IS_INDEXED;
				if (fi.storeTermVector)
					bits |= STORE_TERMVECTOR;
				if (fi.storePositionWithTermVector)
					bits |= STORE_POSITIONS_WITH_TERMVECTOR;
				if (fi.storeOffsetWithTermVector)
					bits |= STORE_OFFSET_WITH_TERMVECTOR;
				if (fi.omitNorms)
					bits |= OMIT_NORMS;
				if (fi.storePayloads)
					bits |= STORE_PAYLOADS;
				if (fi.omitTermFreqAndPositions)
					bits |= OMIT_TERM_FREQ_AND_POSITIONS;
				
				output.WriteString(fi.name);
				output.WriteByte(bits);
			}
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:27,代码来源:FieldInfos.cs


示例14: WriteDgaps

 /// <summary>Write as a d-gaps list </summary>
 private void WriteDgaps(IndexOutput output)
 {
     output.WriteInt(- 1); // mark using d-gaps
     output.WriteInt(Size()); // write size
     output.WriteInt(Count()); // write count
     int last = 0;
     int n = Count();
     int m = bits.Length;
     for (int i = 0; i < m && n > 0; i++)
     {
         if (bits[i] != 0)
         {
             output.WriteVInt(i - last);
             output.WriteByte(bits[i]);
             last = i;
             n -= BYTE_COUNTS[bits[i] & 0xFF];
         }
     }
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:20,代码来源:BitVector.cs


示例15: WriteBits

 /// <summary>Write as a bit set </summary>
 private void WriteBits(IndexOutput output)
 {
     output.WriteInt(Size()); // write size
     output.WriteInt(Count()); // write count
     output.WriteBytes(bits, bits.Length);
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:7,代码来源:BitVector.cs


示例16: Init

 public override void Init(IndexOutput termsOut)
 {
     CodecUtil.WriteHeader(termsOut, Lucene40PostingsReader.TERMS_CODEC, Lucene40PostingsReader.VERSION_CURRENT);
     termsOut.WriteInt(SkipInterval); // write skipInterval
     termsOut.WriteInt(MaxSkipLevels); // write maxSkipLevels
     termsOut.WriteInt(SkipMinimum); // write skipMinimum
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:Lucene40PostingsWriter.cs


示例17: PreFlexRWStoredFieldsWriter

        public PreFlexRWStoredFieldsWriter(Directory directory, string segment, IOContext context)
        {
            Debug.Assert(directory != null);
            this.Directory = directory;
            this.Segment = segment;

            bool success = false;
            try
            {
                FieldsStream = directory.CreateOutput(IndexFileNames.SegmentFileName(segment, "", Lucene3xStoredFieldsReader.FIELDS_EXTENSION), context);
                IndexStream = directory.CreateOutput(IndexFileNames.SegmentFileName(segment, "", Lucene3xStoredFieldsReader.FIELDS_INDEX_EXTENSION), context);

                FieldsStream.WriteInt(Lucene3xStoredFieldsReader.FORMAT_CURRENT);
                IndexStream.WriteInt(Lucene3xStoredFieldsReader.FORMAT_CURRENT);

                success = true;
            }
            finally
            {
                if (!success)
                {
                    Abort();
                }
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:25,代码来源:PreFlexRWStoredFieldsWriter.cs


示例18: Initialize

		private void  Initialize(Directory directory, System.String segment, FieldInfos fis, int interval, bool isi)
		{
			indexInterval = interval;
			fieldInfos = fis;
			isIndex = isi;
			output = directory.CreateOutput(segment + (isIndex ? ".tii" : ".tis"));
			output.WriteInt(FORMAT); // write format
			output.WriteLong(0); // leave space for size
			output.WriteInt(indexInterval); // write indexInterval
			output.WriteInt(skipInterval); // write skipInterval
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:11,代码来源:TermInfosWriter.cs


示例19: TermVectorsWriter

        public TermVectorsWriter(Directory directory, System.String segment, FieldInfos fieldInfos)
        {
            // Open files for TermVector storage
            tvx = directory.CreateOutput(segment + "." + IndexFileNames.VECTORS_INDEX_EXTENSION);
            tvx.WriteInt(TermVectorsReader.FORMAT_CURRENT);
            tvd = directory.CreateOutput(segment + "." + IndexFileNames.VECTORS_DOCUMENTS_EXTENSION);
            tvd.WriteInt(TermVectorsReader.FORMAT_CURRENT);
            tvf = directory.CreateOutput(segment + "." + IndexFileNames.VECTORS_FIELDS_EXTENSION);
            tvf.WriteInt(TermVectorsReader.FORMAT_CURRENT);

            this.fieldInfos = fieldInfos;
        }
开发者ID:BackupTheBerlios,项目名称:lyra2-svn,代码行数:12,代码来源:TermVectorsWriter.cs


示例20: TermVectorsWriter

        public TermVectorsWriter(Directory directory, System.String segment, FieldInfos fieldInfos)
        {
            // Open files for TermVector storage
            tvx = directory.CreateOutput(segment + TVX_EXTENSION);
            tvx.WriteInt(FORMAT_VERSION);
            tvd = directory.CreateOutput(segment + TVD_EXTENSION);
            tvd.WriteInt(FORMAT_VERSION);
            tvf = directory.CreateOutput(segment + TVF_EXTENSION);
            tvf.WriteInt(FORMAT_VERSION);

            this.fieldInfos = fieldInfos;
            fields = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(fieldInfos.Size()));
            terms = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
        }
开发者ID:karino2,项目名称:wikipediaconv,代码行数:14,代码来源:TermVectorsWriter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Store.MockRAMDirectory类代码示例发布时间:2022-05-24
下一篇:
C# Store.IndexInput类代码示例发布时间: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