Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 18067 invoked from network); 31 Dec 2009 01:09:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Dec 2009 01:09:28 -0000 Received: (qmail 89349 invoked by uid 500); 31 Dec 2009 01:09:26 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 89192 invoked by uid 500); 31 Dec 2009 01:09:25 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 89182 invoked by uid 99); 31 Dec 2009 01:09:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 01:09:25 +0000 X-ASF-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gsiasf@gmail.com designates 209.85.217.225 as permitted sender) Received: from [209.85.217.225] (HELO mail-gx0-f225.google.com) (209.85.217.225) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 01:09:17 +0000 Received: by gxk25 with SMTP id 25so5682300gxk.5 for ; Wed, 30 Dec 2009 17:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=DbDZHsDY++1qrova09WkKe/qHJV1IuJlTCllmw08NIw=; b=Tx1HqbB3s5gVp0EPlD5SmcRfx09GGVTPLrCl8HoY3bFvZpP6h6OGhDRAkdoMhzzA9Q iBTkHq4q2hKg4poZQmvvQ8z0nEazq9SiB8Bo2rHS7ZPRLevNX5DxmckoIRwGJ6p2/4YO gIEoqEPN1WteS0KKiUPSx1KgHJylaSxd/yJkE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=wg629KYestpVtlemajqFmWiO+Gki3z91n+jXOMxw9uW+5qGDL6Wfol1SarrIMCETOl 2rtB5o4N8Y33SNV5O1kYDxWM8mFMemNwG7GG3MBPe9fnDsxfVBt7NUo6by9mzXGxvwDp OAt5kjN/zO5tViXKD4Sp5EVBNvaAtEb0uTaP0= Received: by 10.100.56.12 with SMTP id e12mr2603464ana.106.1262221736315; Wed, 30 Dec 2009 17:08:56 -0800 (PST) Received: from ?10.0.0.15? (adsl-065-013-152-164.sip.rdu.bellsouth.net [65.13.152.164]) by mx.google.com with ESMTPS id 6sm4922502ywc.39.2009.12.30.17.08.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Dec 2009 17:08:55 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Copy and augment an indexed Document From: Grant Ingersoll In-Reply-To: <84fb38e30912301408x9cc6e14leb6b5490db8ad640@mail.gmail.com> Date: Wed, 30 Dec 2009 20:08:55 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <822D33FC-2611-443E-85B8-71D0A3C3E023@gmail.com> References: <84fb38e30912301408x9cc6e14leb6b5490db8ad640@mail.gmail.com> To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.1077) 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? >=20 > 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