当前位置: 首页>>代码示例>>C#>>正文


C# SegmentInfo.AdvanceNormGen方法代码示例

本文整理汇总了C#中Lucene.Net.Index.SegmentInfo.AdvanceNormGen方法的典型用法代码示例。如果您正苦于以下问题:C# SegmentInfo.AdvanceNormGen方法的具体用法?C# SegmentInfo.AdvanceNormGen怎么用?C# SegmentInfo.AdvanceNormGen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lucene.Net.Index.SegmentInfo的用法示例。


在下文中一共展示了SegmentInfo.AdvanceNormGen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReWrite

			internal void  ReWrite(SegmentInfo si)
			{
				// NOTE: norms are re-written in regular directory, not cfs
				
				System.String oldFileName = si.GetNormFileName(this.number);
				if (oldFileName != null && !oldFileName.EndsWith("." + IndexFileNames.NORMS_EXTENSION))
				{
					// Mark this file for deletion.  Note that we don't
					// actually try to delete it until the new segments files is
					// successfully written:
					Enclosing_Instance.deleter.AddPendingFile(oldFileName);
				}
				
				si.AdvanceNormGen(this.number);
				IndexOutput out_Renamed = Enclosing_Instance.Directory().CreateOutput(si.GetNormFileName(this.number));
				try
				{
					out_Renamed.WriteBytes(bytes, Enclosing_Instance.MaxDoc());
				}
				finally
				{
					out_Renamed.Close();
				}
				this.dirty = false;
			}
开发者ID:zweib730,项目名称:beagrep,代码行数:25,代码来源:SegmentReader.cs

示例2: ReWrite

            // Flush all pending changes to the next generation
            // separate norms file.
            public void ReWrite(SegmentInfo si)
            {
                System.Diagnostics.Debug.Assert(refCount > 0 && (origNorm == null || origNorm.refCount > 0), "refCount=" + refCount + " origNorm=" + origNorm);

                // NOTE: norms are re-written in regular directory, not cfs
                si.AdvanceNormGen(this.number);
                string normFileName = si.GetNormFileName(this.number);
                IndexOutput @out = enclosingInstance.Directory().CreateOutput(normFileName);
                bool success = false;
                try
                {
                    try {
                        @out.WriteBytes(bytes, enclosingInstance.MaxDoc());
                    } finally {
                        @out.Close();
                    }
                    success = true;
                }
                finally
                {
                    if (!success)
                    {
                        try
                        {
                            enclosingInstance.Directory().DeleteFile(normFileName);
                        }
                        catch (Exception t)
                        {
                            // suppress this so we keep throwing the
                            // original exception
                        }
                    }
                }
                this.dirty = false;
            }
开发者ID:sinsay,项目名称:SSE,代码行数:37,代码来源:SegmentReader.cs

示例3: ReWrite

			// Flush all pending changes to the next generation
			// separate norms file.
			public void  ReWrite(SegmentInfo si)
			{
				System.Diagnostics.Debug.Assert(refCount > 0 && (origNorm == null || origNorm.refCount > 0), "refCount=" + refCount + " origNorm=" + origNorm);
				
				// NOTE: norms are re-written in regular directory, not cfs
				si.AdvanceNormGen(this.number);
				IndexOutput out_Renamed = Enclosing_Instance.Directory().CreateOutput(si.GetNormFileName(this.number));
				try
				{
					out_Renamed.WriteBytes(bytes, Enclosing_Instance.MaxDoc());
				}
				finally
				{
					out_Renamed.Close();
				}
				this.dirty = false;
			}
开发者ID:nzdunic,项目名称:ravendb,代码行数:19,代码来源:SegmentReader.cs

示例4: ReWrite

 internal void ReWrite(SegmentInfo si)
 {
     // NOTE: norms are re-written in regular directory, not cfs
     si.AdvanceNormGen(this.number);
     IndexOutput out_Renamed = Enclosing_Instance.Directory().CreateOutput(si.GetNormFileName(this.number));
     try
     {
         out_Renamed.WriteBytes(bytes, Enclosing_Instance.MaxDoc());
     }
     finally
     {
         out_Renamed.Close();
     }
     this.dirty = false;
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:15,代码来源:SegmentReader.cs


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