Hi You cannot just update headers -- the file formats have changed. Therefore you need to rewrite the index entirely, at least from 2.3.1 to 3.6.2 (for 4.1 to be able to read it). If your index is already optimized, then IndexUpgrader is your best option. The reason it calls forceMerge(1) is that it needs to guarantee *every* segment in your index gets rewritten.
BTW, you might want to upgrade to 4.4 already. Shai On Fri, Aug 2, 2013 at 2:49 PM, Ramprakash Ramamoorthy < youngestachie...@gmail.com> wrote: > Team, > > We are migrating from lucene version 2.3.1 to 4.1. We are migrating > the indices as well, and we do this in two steps 2.3.1 to 3.6.2 and 3.6.2 > to 4. We just call IndexUpgrader.upgrade(), using the > IndexUpgraderMergePolicy. I see that, the upgrade() method actually calls a > forcemerge(1) over the indices. > > However, we have all our indices optimized and there are no deletes > as well. This forcemerge(1) seems a very costly operation and since our > index is already optimized, there is no space benefit as well. Is there a > faster way to upgrade our indices (like reading the indices and modifying > the headers, something of that sort)? We are not expecting any compaction > during the process. > > Currently it takes 4 minutes for a GB of index to get migrated to > 4.1 from 2.3.1. Any pointers would be appreciated. Thanks in advance. > > > -- > With Thanks and Regards, > Ramprakash Ramamoorthy, > Chennai, India. >