Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 6871 invoked from network); 11 Aug 2006 06:02:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Aug 2006 06:02:07 -0000 Received: (qmail 86974 invoked by uid 500); 11 Aug 2006 06:02:01 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 86948 invoked by uid 500); 11 Aug 2006 06:02:01 -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 86931 invoked by uid 99); 11 Aug 2006 06:02:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2006 23:02:01 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DATE_IN_PAST_12_24,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of codeshepherd@gmail.com designates 64.233.166.183 as permitted sender) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2006 23:01:49 -0700 Received: by py-out-1112.google.com with SMTP id s49so8630pyc for ; Thu, 10 Aug 2006 22:59:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:subject:from:to:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=anl0xWpQTSvU/vI8taLyrMAaV9T5qPoRd98rX14IeTd4+EJiWSfjdynAhKJov8hiK4K3kcOjVq4SjNmhQ01Gyb+ZaJV2Ks8DTtl4GOCbtU6kalmCXplRlPu02nIyuIMLaJwcahFyPcQgP94HLQ5JkFjpvioOCLx6a273MEP240c= Received: by 10.35.121.9 with SMTP id y9mr5339986pym; Thu, 10 Aug 2006 22:59:53 -0700 (PDT) Received: from ?10.1.1.2? ( [59.92.88.244]) by mx.gmail.com with ESMTP id n78sm1604695pyf.2006.08.10.22.59.51; Thu, 10 Aug 2006 22:59:53 -0700 (PDT) Subject: Re: updating document From: Deepan Chakravarthy To: java-user@lucene.apache.org In-Reply-To: References: <1155145453.2739.8.camel@localhost.localdomain> <359a92830608100616re219fe3la419623871885798@mail.gmail.com> <1155171673.3388.3.camel@localhost.localdomain> Content-Type: text/plain Date: Thu, 10 Aug 2006 22:59:41 +0530 Message-Id: <1155230981.9137.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 (2.6.0-1) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Fri, 2006-08-11 at 01:58 +1000, Jason Polites wrote: > Are your storing the contents of the fields in the index? That is, > specifying Field.Store.YES when creating the field? > > In my experience fields which are not stored are not recoverable from the > index (well.. they can be reconstructed but it's a lossy process). So when > you retrieve the document, you lose non-stored fields. > Yes we have some important fields that are not stored in the index. Is there a way to overcome this problem? while updating document. Will i face the same problem with IndexModifier ? (Now I am using IndexReader and IndexWriter) Thanks Deepan www.codeshepherd.com > If you are searching on these fields then it would explain why you are > losing results. > > On 8/10/06, Deepan Chakravarthy wrote: > > > > On Thu, 2006-08-10 at 09:16 -0400, Erick Erickson wrote: > > > You say "Those documents that we updated are not searchable now". I've > > got > > > to ask the obvious question, did you close and re-open the *searcher* > > > (really, the indexreader you use in your searcher)? I suspect you have, > > but > > > thought I'd ask explicitly. > > > > > > I'd also get a copy of Luke (http://www.getopt.org/luke/) and inspect my > > > index after you drop/re-add the data. > > I have Luke. When i inspect the index with luke i find the same result, > > i.e the updated documents are not searchable in the new index. > > > > I guess Index Modifier used Index reader and writer internally. I am > > adding more fields to existing documents in index. so some of my > > documents will have n fields and other n+m fields after updating. Does > > the difference in number of fields affect search in any manner ? > > > > > > > > > > Actually, have you thought about IndexModifier (I'm using Lucene 2.0). > > From > > > the javadoc.... > > > > > > <<< A class to modify an index, i.e. to delete and add documents. This > > class > > > hides IndexReader< > > file:///C:/lucene-2.0.0/docs/api/org/apache/lucene/index/IndexReader.html > > >and > > > IndexWriter< > > file:///C:/lucene-2.0.0/docs/api/org/apache/lucene/index/IndexWriter.html > > >so > > > that you do not need to care about implementation details such as that > > > adding documents is done via IndexWriter and deletion is done via > > > IndexReader.>>> > > > > > > Best > > > Erick > > > > > > On 8/9/06, Deepan Chakravarthy wrote: > > > > > > > > Hi, > > > > We have to update few documents in our index. We have add a additional > > > > field to them. We did as follows > > > > > > > > 1)read the documents of our interest using IndexReader > > > > 2)copy them to a temporary doc object (temp_doc) > > > > 3)delete the document in the index > > > > 4)close the IndexReader > > > > 5)open the IndexWriter > > > > 6)add a new field to (temp_doc) > > > > 7)add the (temp_doc) to the index using IndexWriter > > > > 8)close the IndexWriter > > > > > > > > > > > > The problem: > > > > 1)Those documents that we updated are not searchable now. When we > > > > perform search based we not find any of those documents we updated. > > > > (using IndexSearcher) > > > > > > > > 2)But we are still able to read the updated documents using > > IndexReader. > > > > > > > > > > > > Questions > > > > 1)When i want to update a document by adding a field, should i reindex > > > > all the fields again? will copying the existing document not help and > > > > adding new field not help ? > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > 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 > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org