I want to delete all the previously created indices. I am using Lucene.net.
I tried the following:
Term term = new Term
From the Lucene.Net API Doc:
public static IndexReader Open(Directory);Expert: Returns a read/write IndexReader reading the index in the given Directory, with a custom IndexDeletionPolicy. NOTE: Starting in 3.0 this will return a readOnly IndexReader. Throws CorruptIndexException if the index is corrupt. Throws IOException if there is a low-level IO error.
i guess you should try
IndexReader rdr = IndexReader.Open(_directory, true);