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();

posted @ 2009-10-08 19:03  searchDM  阅读(280)  评论(0编辑  收藏  举报