Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 90817 invoked from network); 30 Jan 2008 18:57:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2008 18:57:34 -0000 Received: (qmail 73062 invoked by uid 500); 30 Jan 2008 18:57:18 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 73006 invoked by uid 500); 30 Jan 2008 18:57:18 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 72995 invoked by uid 99); 30 Jan 2008 18:57:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2008 10:57:18 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.44.16.11] (HELO getopt.org) (69.44.16.11) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2008 18:57:03 +0000 Received: from [192.168.1.100] ([81.219.54.251]) (authenticated) by getopt.org (8.11.6/8.11.6) with ESMTP id m0UIv3K08800 for ; Wed, 30 Jan 2008 12:57:07 -0600 Message-ID: <47A0C863.9050105@getopt.org> Date: Wed, 30 Jan 2008 19:56:35 +0100 From: Andrzej Bialecki User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: java-dev@lucene.apache.org Subject: Re: Updating Lucene Index with Unstored fields References: <15188818.post@talk.nabble.com> In-Reply-To: <15188818.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org philipc wrote: > hi, > > I'm trying to add a new field to all the documents in a lucene index. > After searching around, I found the only way to do an update > is by retrieve the old documents, update it, delete it, then re-add > to index. > > However, this worked for only preserving the stored fields. > i've lost all the unstored fields from the documents. > is there anyway to keep the unstored fields as well? > > Or any way to go around the problem, > ie, anyway to export the entire index to a csv file > and then update the cvs, and then import it back? Here's an idea: create an index consisting of documents with just this field, adding documents in exactly the same order as they are in the other index. Then use ParallelReader to access both indexes at the same time - ParallelReader will present a merged view of both indexes. You can also use IndexWriter.addIndexes() to create a merged index. -- Best regards, Andrzej Bialecki <>< ___. ___ ___ ___ _ _ __________________________________ [__ || __|__/|__||\/| Information Retrieval, Semantic Web ___|||__|| \| || | Embedded Unix, System Integration http://www.sigram.com Contact: info at sigram dot com --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org