本文整理汇总了C#中Lucene.Net.Index.SegmentInfos.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# SegmentInfos.Commit方法的具体用法?C# SegmentInfos.Commit怎么用?C# SegmentInfos.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.SegmentInfos
的用法示例。
在下文中一共展示了SegmentInfos.Commit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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());
}