private void EnsureDirectoryExists()
{
try
{
if (!Directory.Exists(IndexPath))
Directory.CreateDirectory(IndexPath);
}
catch (IOException ex)
{
throw new SearchException(ex, "An error occured while creating the search directory '{0}'", IndexPath);
}
}