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


C# IndexWriter.Merge方法代码示例

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


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

示例1: Merge

		/// <summary>Just do the merges in sequence. We do this
		/// "synchronized" so that even if the application is using
		/// multiple threads, only one merge may run at a time. 
		/// </summary>
		public override void  Merge(IndexWriter writer)
		{
			lock (this)
			{
				
				while (true)
				{
					MergePolicy.OneMerge merge = writer.GetNextMerge();
					if (merge == null)
						break;
					writer.Merge(merge);
				}
			}
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:18,代码来源:SerialMergeScheduler.cs

示例2: Merge

 public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
 {
     lock (this)
     {
         while (true)
         {
             MergePolicy.OneMerge merge = writer.NextMerge;
             if (merge == null)
             {
                 break;
             }
             for (int i = 0; i < merge.Segments.Count; i++)
             {
                 Debug.Assert(merge.Segments[i].Info.DocCount < 20);
             }
             writer.Merge(merge);
         }
     }
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:19,代码来源:TestIndexWriterMerging.cs

示例3: Merge

			public override /*virtual*/ void  Merge(IndexWriter writer)
			{
				lock (this)
				{
					
					while (true)
					{
						MergePolicy.OneMerge merge = writer.GetNextMerge();
						if (merge == null)
							break;
						for (int i = 0; i < merge.segments_ForNUnit.Count; i++)
							; // {{}} assert merge.segments.Info(i).docCount < 20;
						writer.Merge(merge);
					}
				}
			}
开发者ID:Rationalle,项目名称:ravendb,代码行数:16,代码来源:TestIndexWriter.cs

示例4: Merge

			public override void  Merge(IndexWriter writer)
			{
				lock (this)
				{
					
					while (true)
					{
						MergePolicy.OneMerge merge = writer.GetNextMerge();
						if (merge == null)
							break;
						for (int i = 0; i < merge.Segments_ForNUnitTest.Count; i++)
							System.Diagnostics.Debug.Assert(merge.Segments_ForNUnitTest.Info(i).docCount < 20);
						writer.Merge(merge);
					}
				}
			}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:16,代码来源:TestIndexWriter.cs

示例5: Merge

		public override void  Merge(IndexWriter writer)
		{
			
			this.writer = writer;
			
			InitMergeThreadPriority();
			
			dir = writer.GetDirectory();
			
			// First, quickly run through the newly proposed merges
			// and add any orthogonal merges (ie a merge not
			// involving segments already pending to be merged) to
			// the queue.  If we are way behind on merging, many of
			// these newly proposed merges will likely already be
			// registered.
			
			Message("now merge");
			Message("  index: " + writer.SegString());
			
			// Iterate, pulling from the IndexWriter's queue of
			// pending merges, until its empty:
			while (true)
			{
				
				// TODO: we could be careful about which merges to do in
				// the BG (eg maybe the "biggest" ones) vs FG, which
				// merges to do first (the easiest ones?), etc.
				
				MergePolicy.OneMerge merge = writer.GetNextMerge();
				if (merge == null)
				{
					Message("  no more merges pending; now return");
					return ;
				}
				
				// We do this w/ the primary thread to keep
				// deterministic assignment of segment names
				writer.MergeInit(merge);
				
				Message("  consider merge " + merge.SegString(dir));
				
				if (merge.isExternal)
				{
					Message("    merge involves segments from an external directory; now run in foreground");
				}
				else
				{
					lock (this)
					{
						if (MergeThreadCount() < maxThreadCount)
						{
							// OK to spawn a new merge thread to handle this
							// merge:
							MergeThread merger = new MergeThread(this, writer, merge);
							mergeThreads.Add(merger);
							Message("    launch new thread [" + merger.Name + "]");
							merger.SetThreadPriority(mergeThreadPriority);
							merger.IsBackground = true;
							merger.Start();
							continue;
						}
						else
							Message("    too many merge threads running; run merge in foreground");
					}
				}
				
				// Too many merge threads already running, so we do
				// this in the foreground of the calling thread
				writer.Merge(merge);
			}
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:71,代码来源:ConcurrentMergeScheduler.cs


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