From 14d346fd6b763b37fb841c0e1e4b040007f81ba8 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 14 Jul 2020 12:46:39 +1000 Subject: [PATCH] further fix #164 --- src/Examine/LuceneEngine/Providers/LuceneIndex.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Examine/LuceneEngine/Providers/LuceneIndex.cs b/src/Examine/LuceneEngine/Providers/LuceneIndex.cs index b8b5965e1..25691c8cd 100644 --- a/src/Examine/LuceneEngine/Providers/LuceneIndex.cs +++ b/src/Examine/LuceneEngine/Providers/LuceneIndex.cs @@ -407,6 +407,12 @@ private void CreateNewIndex(Directory dir) } //create the writer (this will overwrite old index files) writer = new IndexWriter(dir, FieldAnalyzer, true, IndexWriter.MaxFieldLength.UNLIMITED); + + // clear out current scheduler and set the error logging one + using (writer.MergeScheduler) { } + writer.SetMergeScheduler(new ErrorLoggingConcurrentMergeScheduler(Name, + (s, e) => OnIndexingError(new IndexingErrorEventArgs(this, s, "-1", e)))); + } catch (Exception ex) {