lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
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).

Mike

On Wed, Apr 14, 2010 at 6:52 PM, Lance Norskog <goksron@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
> goksron@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message