lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Desteny Child <myshar...@gmail.com>
Subject Lucene indexes getting deleted after application restart
Date Wed, 06 Jul 2016 17:57:59 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message