Delete all indices in Lucene.net

前端 未结 4 947
栀梦
栀梦 2021-01-18 02:50

I want to delete all the previously created indices. I am using Lucene.net.

I tried the following:

Term term = new Term         


        
4条回答
  •  春和景丽
    2021-01-18 03:27

    As Jokin said, the easiest was is to delete all of the files within the directory. i.e.;

    DirectoryInfo directoryInfo = new DirectoryInfo(@"IndexLocation");
    Parallel.ForEach(directoryInfo.GetFiles(), file => {
                file.Delete();
            });
    

提交回复
热议问题