lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Copying documents
Date Tue, 25 Jul 2006 18:46:50 GMT

: I want to copy a selection of documents from one index to another. I can
: get the Document objects from the IndexReader and write them to the
: target index using the IndexWriter. The problem I have is this loses
: fields that have not been stored, is there a way round this.

there is no easy way to extract non-stored fields from an index.

if your goal is as you say just to verbatim copy documents from one index
to another, look at the IndexWriter.addIndexes method which merges the
Term lists directly (without trying to reconstruct the orriginal

if you only want a subset of your orriginal index, clone it's directory,
delete the docs you don't wnat to copy, and then add the index.


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

View raw message