lucene的写操作,默认的时候writer = new IndexWriter(indexDir, analyzer, override);当override为TRUE的时候,lucene将进行重写操作,override为FALSE的时候将是增量索引的过程,对于重复的文章仍旧重复索引的。
if (writer == null) {
try {
writer = new IndexWriter(indexDir, analyzer, override);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
if (writer != null) {
writer.setMaxMergeDocs(25);
writer.setMaxBufferedDocs(25);
}
}