lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsi...@gmail.com>
Subject Re: Copy and augment an indexed Document
Date Thu, 31 Dec 2009 01:08:55 GMT

On Dec 30, 2009, at 5:08 PM, tsuraan wrote:

> Suppose I have a (useful) document stored in a Lucene index, and I
> have a variant that I'd also like to be able to search.  This variant
> has the exact same data as the original document, but with some extra
> fields.  I'd like to be able to use an IndexReader to get the document
> that I stored, use the document's add method to put my extra fields
> in, and then add that document to the index using an IndexWriter.
> This doesn't seem to work, in general.  Non-stored fields of the
> original document are not in the variant document.  This makes sense
> from an OO point of view (how would that document object possibly have
> the non-stored data of the original doc), but is there some
> lower-level way to do what I want to do?
> 
> It's somewhat expensive to completely re-create my document, as it
> relies on data parsed from (often large) pdf and MS Office files.  I'd
> like to be able to use the already-stored terms that are in my index
> and associated with my existing document.  Can I iterate through the
> terms of my index and add references to my newly-added document?  Is
> there any utility to make this work nicely

I don't think there is a way to do this without recreating docs just yet although I believe
there is some work being done on modifiable docs.  Can you store all your fields?  That is
probably cheaper than reparsing.

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