I am using Lucene in a web application. Lucene is used to create index when an article is added. Since only one IndexWriter instance may exist for an index directory, I use a singleton IndexWriter for the application.
- When should I close IndexWriter to commit all documents to the index directory?
- If the web server (tomcat) goes down, how should I recover the uncommitted documents? Has Lucene offered any ways to recover from a crash?