title: Using IndexReader IsLocked and Unlock methods
body: <p>Before calling <code>AddDocument()</code> on <code>IndexWriter</code>, is it okay if I call</p>
  
  <pre><code>IndexReader.IsLocked(myDirectory)
  </code></pre>
  
  <p>and if it returns true, then call</p>
  
  <pre><code>IndexReader.Unlock(myDirectory)
  </code></pre>
  
  <p>i.e.</p>
  
  <pre><code>if(IndexReader.IsLocked(myDirectory))
  {
  IndexReader.Unlock(myDirectory);
  }
  
  writer = new IndexWriter(myDirectory, _analyzer, true);
  writer.AddDocument(doc);
  </code></pre>
  
  <p>I keep getting "Lock obtain timed out." errors in my code.
  To overcome this error, I plan to this approach if it is okay.</p>