I am using Lucene.Net for indexing and searching documents, and I am using the following code to create or open an index if one exists:
IndexWriter writer = new IndexWriter(@"C:\index", new StandardAnalyzer(), !IndexExists);
...
private bool IndexExists
{
get
{
return ??
}
}
Now, how can implement IndexExists in a simple way? I don’t need any exceptions to be thrown.
The static method IndexReader.IndexExists(string path) (or one of its overloads) seems pretty suitable.