lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saurabh Gokhale <saurabhgokh...@gmail.com>
Subject Need Help: Index directory files getting deleted due to server restart.
Date Thu, 28 Jul 2011 19:12:38 GMT
Hi All,

I am using following code to create Lucene index using writer object

if (indexWriter == null) {
        Directory idx = new NIOFSDirectory(new File(indexDir),null);
IndexWriterConfig iConfig = new IndexWriterConfig(Version.LUCENE_31,
getAnalyzer());
iConfig.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);
indexWriter = new IndexWriter(idx, iConfig);

indexWriter.setRAMBufferSizeMB(50);
indexWriter.setMaxBufferedDocs(100);
}

return indexWriter;

I have the application hosted on Tomcat 7. Now whenever I start / restart my
tomcat server, my index directory gets cleaned up (all lucene index files
are removed) and fresh indexing starts.

How can I stop it from happening? If this is the expected behavior, is there
any work around?

Thanks

Saurabh

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