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-07 14:50  waynecn  阅读(570)  评论(0编辑  收藏  举报