本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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;
}
}
示例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;
}