From 5fb1fd14048770f46db0fe518a13d3b7d48a761e Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 19 Jul 2024 08:44:10 -0600 Subject: [PATCH] try again --- .../Directories/SyncedFileSystemDirectoryFactoryTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Examine.Test/Examine.Lucene/Directories/SyncedFileSystemDirectoryFactoryTests.cs b/src/Examine.Test/Examine.Lucene/Directories/SyncedFileSystemDirectoryFactoryTests.cs index 5059703e..28f35660 100644 --- a/src/Examine.Test/Examine.Lucene/Directories/SyncedFileSystemDirectoryFactoryTests.cs +++ b/src/Examine.Test/Examine.Lucene/Directories/SyncedFileSystemDirectoryFactoryTests.cs @@ -119,7 +119,7 @@ private void CreateIndex(string rootPath, bool corruptIndex, bool removeSegments var logger = LoggerFactory.CreateLogger(); var indexPath = Path.Combine(rootPath, TestIndex.TestIndexName); - logger.LogInformation("Creating index at " + indexPath); + logger.LogInformation($"Creating index at {indexPath} with options: corruptIndex: {corruptIndex}, removeSegments: {removeSegments}"); using var luceneDir = FSDirectory.Open(indexPath); @@ -149,11 +149,11 @@ private void CreateIndex(string rootPath, bool corruptIndex, bool removeSegments if (corruptIndex) { - CorruptIndex(luceneDir.Directory, removeSegments); + CorruptIndex(luceneDir.Directory, removeSegments, logger); } } - private void CorruptIndex(DirectoryInfo dir, bool removeSegments) + private void CorruptIndex(DirectoryInfo dir, bool removeSegments, ILogger logger) { // Get an index (non segments file) and delete it (corrupt index) var indexFile = dir.GetFiles() @@ -162,7 +162,7 @@ private void CorruptIndex(DirectoryInfo dir, bool removeSegments) : !x.Name.Contains("segments", StringComparison.OrdinalIgnoreCase)) .First(); - Console.WriteLine($"Deleting {indexFile.FullName}"); + logger.LogInformation($"Deleting {indexFile.FullName}"); File.Delete(indexFile.FullName); } }