[ https://issues.apache.org/jira/browse/LUCENE-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030525#comment-13030525 ]
Uwe Schindler commented on LUCENE-3082: --------------------------------------- Shai: - The supplied patch should handle all you want (there would be only one addition, the proposed 'boolean shouldUpgradeSegment(SegmentInfo)' method, which is a one-liner, will upload new patch for that und make the merge policy unfinal. - It will not do cascading merges, because when the merge policy recognizes that all segments have already the new version it will not merge anything. So after the first iteration all segments will be upgraded, so on the next run of this policy, it will return null merges. The other ideas like PayloadProcessor can be done outside of that in user code (but beware, it will not touch segments already in new version). > Add index upgrade method to IndexWriter to force an upgrade of all segments > to last recent supported index format without optimizing > ------------------------------------------------------------------------------------------------------------------------------------ > > Key: LUCENE-3082 > URL: https://issues.apache.org/jira/browse/LUCENE-3082 > Project: Lucene - Java > Issue Type: New Feature > Components: Index > Reporter: Uwe Schindler > Priority: Minor > Fix For: 3.2, 4.0 > > Attachments: LUCENE-3082.patch, index.31.optimized.cfs.zip, > index.31.optimized.nocfs.zip > > > Currently if you want to upgrade an old index to the format of your current > Lucene version, you have to optimize your index or use > addIndexes(IndexReader...) [see LUCENE-2893] to copy to a new directory. The > optimize() approach fails if your index is already optimized. > I propose to add a method to IndexWriter thats similar to optimize(), that > uses a custom MergePolicy to upgrade all segments to the last format. This > MergePolicy could simply also ignore all segments already up-to-date. All > segments in prior formats would be merged to a new segment. The tool could > optionally also optimize the index. > This issue is different from LUCENE-2893, as it would only support upgrading > indexes from previous Lucene versions in-place using the official path. Its a > tool for the end user, not a developer tool. > This addition should also go to Lucene 3.x, as we need to make users with > pre-3.0 indexes go the step through 3.x, else they would not be able to open > their index with 4.0. With this tool in 3.x the users could safely upgrade > their index without relying on optimize to work on already-optimized indexes. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org