Before calling AddDocument() on IndexWriter, is it ok if i call IndexReader.IsLocked(myDirectory) and if it returns true then call, IndexReader.Unlock(myDirectory)?? Please suggest. ie...
if(IndexReader.IsLocked(myDirectory)) { IndexReader.Unlock(myDirectory); }
writer = new IndexWriter(myDirectory, _analyzer, true); writer.AddDocument(doc);
I keep getting "Lock obtain timed out." errors in my code. To overcome this error,I plan to this approach if it is ok.
Thanks for reading.