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


C# SegmentInfos.Add方法代码示例

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


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

示例1: Clone

 /// <summary> Returns a copy of this instance, also copying each
 /// SegmentInfo.
 /// </summary>
 public override object Clone()
 {
     SegmentInfos si = new SegmentInfos();
     for (int i = 0; i < base.Count; i++)
     {
         si.Add(((SegmentInfo)base[i]).Clone());
     }
     si.counter = this.counter;
     si.version = this.version;
     si.generation = this.generation;
     si.lastGeneration = this.lastGeneration;
     return si;
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:16,代码来源:SegmentInfos.cs

示例2: Clone

		/// <summary> Returns a copy of this instance, also copying each
		/// SegmentInfo.
		/// </summary>
		
		public override System.Object Clone()
		{
            SegmentInfos sis = new SegmentInfos();
            for (int i = 0; i < this.Count; i++)
            {
                sis.Add(((SegmentInfo) this[i]).Clone());
            }
            sis.counter = this.counter;
            sis.generation = this.generation;
            sis.lastGeneration = this.lastGeneration;
            // sis.pendingSegnOutput = this.pendingSegnOutput; // {{Aroush-2.9}} needed?
            sis.userData = new System.Collections.Generic.Dictionary<string, string>(userData);
            sis.version = this.version;
            return sis;
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:19,代码来源:SegmentInfos.cs

示例3: Split

 public virtual void Split(DirectoryInfo destDir, string[] segs)
 {
     destDir.Create();
     FSDirectory destFSDir = FSDirectory.Open(destDir);
     SegmentInfos destInfos = new SegmentInfos();
     destInfos.Counter = infos.Counter;
     foreach (string n in segs)
     {
         SegmentCommitInfo infoPerCommit = GetInfo(n);
         SegmentInfo info = infoPerCommit.Info;
         // Same info just changing the dir:
         SegmentInfo newInfo = new SegmentInfo(destFSDir, info.Version, info.Name, info.DocCount, info.UseCompoundFile, info.Codec, info.Diagnostics);
         destInfos.Add(new SegmentCommitInfo(newInfo, infoPerCommit.DelCount, infoPerCommit.DelGen, infoPerCommit.FieldInfosGen));
         // now copy files over
         ICollection<string> files = infoPerCommit.Files();
         foreach (string srcName in files)
         {
             FileInfo srcFile = new FileInfo(Path.Combine(dir.FullName, srcName));
             FileInfo destFile = new FileInfo(Path.Combine(destDir.FullName, srcName));
             CopyFile(srcFile, destFile);
         }
     }
     destInfos.Changed();
     destInfos.Commit(destFSDir);
     // Console.WriteLine("destDir:"+destDir.getAbsolutePath());
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:26,代码来源:IndexSplitter.cs

示例4: ToLiveInfos

        // For infoStream output
        internal virtual SegmentInfos ToLiveInfos(SegmentInfos sis)
        {
            lock (this)
            {
                SegmentInfos newSIS = new SegmentInfos();
                IDictionary<SegmentCommitInfo, SegmentCommitInfo> liveSIS = new Dictionary<SegmentCommitInfo, SegmentCommitInfo>();
                foreach (SegmentCommitInfo info in segmentInfos.Segments)
                {
                    liveSIS[info] = info;
                }
                foreach (SegmentCommitInfo info in sis.Segments)
                {
                    SegmentCommitInfo infoMod = info;
                    SegmentCommitInfo liveInfo;
                    if (liveSIS.TryGetValue(info, out liveInfo))
                    {
                        infoMod = liveInfo;
                    }
                    newSIS.Add(infoMod);
                }

                return newSIS;
            }
        }
开发者ID:joyanta,项目名称:lucene.net,代码行数:25,代码来源:IndexWriter.cs

示例5: Clone

		/// <summary> Returns a copy of this instance, also copying each
		/// SegmentInfo.
		/// </summary>
		
		public override System.Object Clone()
		{
			SegmentInfos sis = new SegmentInfos();

			// Copy Fields. const and static fields are ignored
			sis.counter = this.counter;
			sis.version = this.version;
			sis.generation = this.generation;
			sis.lastGeneration = this.lastGeneration;

			for (int i = 0; i < this.Count; i++)
			{
				sis.Add(((SegmentInfo)this[i]).Clone());
			}
			return sis;
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:20,代码来源:SegmentInfos.cs


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