lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Streeton" <mike.stree...@ardentia.co.uk>
Subject RE: Copying documents
Date Wed, 26 Jul 2006 07:54:44 GMT
Chris,
   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.

Thanks

Mike

www.ardentia.com the home of NetSearch

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: 25 July 2006 19:47
To: java-user@lucene.apache.org
Subject: Re: Copying documents


: 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
documents)

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.



-Hoss


---------------------------------------------------------------------
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