protected override IndexWriterConfig CreateIndexWriterConfig(IndexWriterConfig.OpenMode_e openMode) { IndexWriterConfig conf = base.CreateIndexWriterConfig(openMode); LogMergePolicy lmp = (LogMergePolicy)conf.MergePolicy; lmp.MergeFactor = 2; return(conf); }
/// <summary> /// Override this to customize index settings, e.g. which /// codec to use. /// </summary> protected internal virtual IndexWriterConfig GetIndexWriterConfig(LuceneVersion matchVersion, Analyzer indexAnalyzer, IndexWriterConfig.OpenMode_e openMode) { IndexWriterConfig iwc = new IndexWriterConfig(matchVersion, indexAnalyzer); iwc.SetCodec(new Lucene46Codec()); iwc.SetOpenMode(openMode); // This way all merged segments will be sorted at // merge time, allow for per-segment early termination // when those segments are searched: iwc.SetMergePolicy(new SortingMergePolicy(iwc.MergePolicy, SORT)); return(iwc); }