Hi Trejkaz, yes, it calls forceMerge, but this is just a "trick" to look at each segment while merging. But finally it decides on the version number of each segment, if it gets merged as part of the forceMerge(1). If the version number of an segment is already on the latest version (because the index was already used with 4.10 and new documents were added/updated), it will just remove it from the list of the segs to merge. It looks like the index in 4.10.4 already has a lot of segments on 4.10 version. When you upgrade it directly after that to 5.5.2, of course it has to merge all segments, as all segs are "only on 4.10".
The whole trick is in the IndexUpgraderMergePolicy. This one implements the algorithm above. Uwe ----- Uwe Schindler Achterdiek 19, D-28357 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Trejkaz [mailto:trej...@trypticon.org] > Sent: Monday, May 22, 2017 6:35 AM > To: Lucene Users Mailing List <java-user@lucene.apache.org> > Subject: Does forceMerge(1) not always merge to one segment? > > We're using IndexUpgrader to upgrade indexes. > > The 4.10.4 version of this appears to be implemented with a call to > forceMerge(1). But when I look at the result for one particular index > here, I see that it has 11 segments after doing the merge. > > When the 5.5.2 version was then run against the same index, it brought > it down to 2 ... but it seems to have been implemented using > forceMerge(1) too. > > What is going on here? > > TX > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org