lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Streeton" <>
Subject RE: Copying documents
Date Wed, 26 Jul 2006 07:54:44 GMT
   Thanks for this I will have to do it the long hand way, we are trying
to create "search marts" containing a smaller index from a much larger
one, so cloning and deleting will not work.


Mike the home of NetSearch

-----Original Message-----
From: Chris Hostetter [] 
Sent: 25 July 2006 19:47
Subject: Re: Copying documents

: I want to copy a selection of documents from one index to another. I
: 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
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:

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

View raw message