You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by An Hong <An...@i365.com> on 2009/02/24 01:18:42 UTC

Upgrading an old index to 2.4 format

I've several existing indexes in 2.1 file format.  If these indexes have multiple segments and have not been optimized, a call to IndexWriter.optimize() should create a newly merged segment of the latest 2.4 file format.  Is this true?  And, is there a way to force a file format upgrade on a 2.1 index that's already in optimized state?
Thanks,
An


Re: Upgrading an old index to 2.4 format

Posted by Michael McCandless <lu...@mikemccandless.com>.
That is true.

Good question on converting an already optimized index... I haven't  
tested this, and it's somewhat roundabout, but you may be able to open  
an IndexWriter, then call setUseCompoundFile with the opposite of what  
your index presently has, run optimize, set that back, and run  
optimize again.  I think it should work.

You could also add and then delete a single doc, then call optimize.

Mike

An Hong wrote:

>
> I've several existing indexes in 2.1 file format.  If these indexes  
> have multiple segments and have not been optimized, a call to  
> IndexWriter.optimize() should create a newly merged segment of the  
> latest 2.4 file format.  Is this true?  And, is there a way to force  
> a file format upgrade on a 2.1 index that's already in optimized  
> state?
> Thanks,
> An
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org