lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Is there any way to optimize existing unoptimized index?
Date Thu, 08 Feb 2007 11:35:34 GMT
maureen tanuwidjaja wrote:

>   May I also ask wheter there is a way to use writer.optimize() without indexing the
files from the beginning?
>   It took me about 17 hrs to finish building an unoptimized index(finish  when I call
IndexWriter.close() ).I just wonder wheter this existing  index could be optimized...

You can always open a new IndexWriter on your index, do things like
addDocument, optimize, etc., and then close it.

There's no requirement that you do addDocument / optimize in a single
session of IndexWriter.

But do be careful not to pass "create = true" to IndexWriter.

The trunk (soon to be 2.1 release) version of Lucene has new
IndexWriter constructors that "create when needed, else append", see


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message