Hi, I often get a FileNotFoundException when my single IndexWriter commits while the IndexReader also tries to read. My application is multithreaded (Tomcat uses the business APIs); I firstly thought the read/write access was thread-safe but I probably forget something.
Please help me to understand my mistakes: - When should I close the IndexWriter ? Each time I add/update a document or never ? - Should my java commit/read methods be synchronized ? - Should I lock the directory and what's the best way to do it ? I referred to the Lucene FAQ ("why do I sometimes get a FileNotFoundException when I search and update my index at the same time?") but I did not disable any locking for processes searching or updating the index. I use lucene-2.4.1. Thanks in advance, Tom