lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Utility program to extract a segment
Date Wed, 14 Apr 2010 23:34:33 GMT
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).


On Wed, Apr 14, 2010 at 6:52 PM, Lance Norskog <> 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
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message