Lucene.net索引合并
Lucene.net索引合并
Lucene.Net.Store.Directory directory1 = FSDirectory.GetDirectory("e:""Index1", false);
Lucene.Net.Store.Directory directory2 = FSDirectory.GetDirectory("e:""Index2", false);
IndexWriter writer = new IndexWriter(directory1, new ChineseAnalyzer(), false);
writer.AddIndexes(new Lucene.Net.Store.Directory[] { directory2 });
Console.WriteLine("正在合并索引"+writer.DocCount().ToString());
writer.Close();