Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 69324 invoked from network); 30 Oct 2009 07:22:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Oct 2009 07:22:12 -0000 Received: (qmail 91777 invoked by uid 500); 30 Oct 2009 07:22:10 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 91698 invoked by uid 500); 30 Oct 2009 07:22:09 -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 91650 invoked by uid 99); 30 Oct 2009 07:22:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 07:22:09 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anshumg@gmail.com designates 209.85.160.46 as permitted sender) Received: from [209.85.160.46] (HELO mail-pw0-f46.google.com) (209.85.160.46) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Oct 2009 07:22:07 +0000 Received: by pwi12 with SMTP id 12so561495pwi.5 for ; Fri, 30 Oct 2009 00:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=+K3tNh4Q7aIY/FICFWXONgf+otpejJpnNNGacdfJpn0=; b=cpm/tagDqBR44OE2MY3fV3l0A5SMFb6cPrIr6WSZ2p+JphEioFlzHVVBKgqi0Fc2Oy 9lpoksogl5/ABbBQXm/r4is/V8Jvia30Ag/2BexaVkLCDZDQajOgd438zXQj4xUN4tgy b+xS1/sG+kKdFZ1Y9uKsz0V5HpQxUFEcksarc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=DwcwyCz66Pd1itD7kOz7n64AHLbwIk/c1/SR9lzYRzUJlDX9MxzIbL4xz9XCrjw8yV EIG7LAzJqT26NEZS8+UFbM1XpvMsUJsy2QOLOMGNiHW/Jx1im0qD6UfFGIH8zGT09Ap/ wj+Oi5iIEPalLtLfYHvzwDsAgf/oD+0P8fCC4= MIME-Version: 1.0 Received: by 10.114.55.40 with SMTP id d40mr965520waa.169.1256887307259; Fri, 30 Oct 2009 00:21:47 -0700 (PDT) In-Reply-To: <944134.7401.qm@web94809.mail.in2.yahoo.com> References: <902479.51158.qm@web94807.mail.in2.yahoo.com> <944134.7401.qm@web94809.mail.in2.yahoo.com> From: Anshum Date: Fri, 30 Oct 2009 12:51:27 +0530 Message-ID: <867513fe0910300021k5f9766e1nf97f7e2bae5e1489@mail.gmail.com> Subject: Re: soln found for index overwritting problem To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001636b2ad2678cec2047721e188 --001636b2ad2678cec2047721e188 Content-Type: text/plain; charset=ISO-8859-1 The only way to do it is to index a field (self maintained primary key) with each document and do a deleteDocument (or updateDocument) for each document before adding it. Something like *writer.deleteDocument(new Term("term-key","unique-id"));* *writer.addDocument(d);* This should help. -- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw............ On Fri, Oct 30, 2009 at 12:20 PM, DHIVYA M wrote: > Thanks a lot sir. Its working out well. > > But i have one more doubt. > Is it possible to check whether the same documents are indexed again and > again? > bcos due to appending of indexes, > when i search a query, > the result is displayed as much number of times as the index is created for > that document. > > how to solve this sir > > Is it possible to remove duplicates with a flag in indexwriter? > > Kindly let me know about this. > > Thanks in advance > M.Dhivya > > > Keep up with people you care about with Yahoo! India Mail. Learn how. > http://in.overview.mail.yahoo.com/connectmore --001636b2ad2678cec2047721e188--