I don't think there's an existing tool, but it shouldn't be too hard to create.
Create a new SegmentInfos(), then call its .read(oldDir) to read all segments. Look up the SegmentInfo(s) you want to copy and call their .files() methods to see which files to copy. Copy them. Remove all other segments from the SegmentInfos, then .write(newDir). Mike On Wed, Apr 14, 2010 at 6:52 PM, Lance Norskog <goks...@gmail.com> wrote: > Is there a program available that makes a new index with one or more > segments from an existing index? (The immediate use case for this is > doing forensics on corrupted indexes.) > > The user interface would be: > extract -segments _ab,_g9 oldindex newindex > > This would copy the files for segments _ab and _g9 into a new > directory and generate a segments.gen for just those two segments. Is > this all that's needed? > > -- > Lance Norskog > goks...@gmail.com > > --------------------------------------------------------------------- > 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