diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs index fed0cedc654..bfb17e4315f 100644 --- a/src/DynamoCore/Models/DynamoModel.cs +++ b/src/DynamoCore/Models/DynamoModel.cs @@ -1019,6 +1019,8 @@ protected DynamoModel(IStartConfiguration config) State = DynamoModelState.StartedUIless; // This event should only be raised at the end of this method. DynamoReady(new ReadyParams(this)); + // Write index to disk only once + LuceneUtility.CommitWriterChanges(); } /// @@ -1496,8 +1498,6 @@ private void InitializeCustomNodeManager() AddNodeTypeToSearchIndex(searchElement, iDoc); } - LuceneUtility.CommitWriterChanges(); - Action infoUpdatedHandler = null; infoUpdatedHandler = newInfo => { @@ -1689,12 +1689,6 @@ private void InitializeNodeLibrary() } CustomNodeManager.AddUninitializedCustomNodesInPath(pathManager.CommonDefinitions, IsTestMode); - - // Initialize searcher, if the applyAllDeletes is true all buffered deletes on documents will be applied (made visible) in the returned reader - // When running parallel tests several are trying to write in the AppData folder then the job - // is failing and in a wrong state so we prevent to initialize Lucene index writer during test mode. - // Without the index files on disk, the dirReader cant be initialized correctly. So does the searcher. - LuceneUtility.CommitWriterChanges(); } ///