Hi! In my Spring/Lucene application I'm using Lucene IndexWriter, TrackingIndexWriter, SearcherManager and ControlledRealTimeReopenThread.
I use open mode - IndexWriterConfig.OpenMode.CREATE_OR_APPEND. Right now I'm trying to index a thousands of a documents. For this purpose I have added Apache ActiveMQ and indexing every document in a separate message consumer. I noticed one serious issue - in case of abnormal JVM termination after the next application restart my Lucene index is empty because IndexWriter.commit() operation was not performed. If I invoke IndexWriter.commit() after each trackingIndexWriter.addDocument(document); everything works fine. I don't think it is a good idea to use IndexWriter.commit() after each trackingIndexWriter.addDocument(document); especially from performance point of view. How to correctly manage my index in order to not lose it after application abnormal termination? Thanks, Alex