Skip to content

Commit

Permalink
fix corrupt data catalog 2
Browse files Browse the repository at this point in the history
  • Loading branch information
steinho committed Aug 12, 2024
1 parent 9656bb6 commit 45d4170
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Nbic.Indexer/Index.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ public Index(bool waitForLockFile = false, bool deleteAndCreateIndex = false)
_lockWasTaken = true;
}

if (deleteAndCreateIndex)
{
System.IO.DirectoryInfo di = new DirectoryInfo(indexLocation.Replace("index",""));

foreach (FileInfo file in di.GetFiles())
{
file.Delete();
}
foreach (DirectoryInfo dir in di.GetDirectories())
{
dir.Delete(true);
}
}

_dir = FSDirectory.Open(indexLocation);
_taxonomydir = FSDirectory.Open(indexLocation.Replace("index","facets"));
Expand Down

0 comments on commit 45d4170

Please sign in to comment.