bool creat = true;
            if (this.is_check.Checked)
            {
                creat = false;
            }
            this.tip_Title.Text = "添加索引:开始 ";
            string Old_Path = this.txt_path.Text.Trim();
            string New_Path = Old_Path.Replace("backup", "index");
            IndexWriter modifier = new IndexWriter(Old_Path, new IKAnalyzer(),creat);
            modifier.SetRAMBufferSizeMB(1000);
            modifier.SetMergeFactor(20);
            int i = 0;
            int j = 0;
            List<int> l_int = new List<int>();

lucene 增量索引,当creat 为true 原索引不存在就创建,存在就覆盖.

当creat为false 不存在原索引会报错,存在就追加索引

posted on 2011-05-18 13:26  白草红叶  阅读(272)  评论(0编辑  收藏  举报