title: How to handle Hibernate-Search index recovery?
body: <p>When an application server exits unexpectedly, Hibernate Search can not do a graceful shutdown of Lucene. Leaving <strong>write.lock</strong> files behind in each index directory. That is of course quite normal. But - the lock files also remain after restarting the application. Which causes lock timeout exceptions at some time.</p>
  
  <p>My question is whether there is a usual way to handle the recovery.</p>
  
  <p>What comes first at mind would be to check for the presence of write.lock files. If one is found, they are removed and all indices are rebuilt. But maybe Hibernate-Search does this automatically when properly configured ?</p>