Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 38702 invoked from network); 19 Nov 2007 11:19:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Nov 2007 11:19:24 -0000 Received: (qmail 93289 invoked by uid 500); 19 Nov 2007 11:19:05 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 93250 invoked by uid 500); 19 Nov 2007 11:19:05 -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 93238 invoked by uid 99); 19 Nov 2007 11:19:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Nov 2007 03:19:05 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Nov 2007 11:18:52 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Iu4eM-00058K-Il for java-user@lucene.apache.org; Mon, 19 Nov 2007 03:18:46 -0800 Message-ID: <13833730.post@talk.nabble.com> Date: Mon, 19 Nov 2007 03:18:46 -0800 (PST) From: flateric To: java-user@lucene.apache.org Subject: RE: neither IndexWriter nor IndexReader would delete documents In-Reply-To: <4FA8C6AEE609B644B38DE471A3657A620256C370@INVS1.bangalore.corp.akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: eballnath@yahoo.de References: <13824599.post@talk.nabble.com> <4FA8C6AEE609B644B38DE471A3657A620256C370@INVS1.bangalore.corp.akamai.com> X-Virus-Checked: Checked by ClamAV on apache.org Hallo Kapil; thanks for your quick answer: * "An IndexReader can be opened on a directory for which an IndexWriter is opened already, but it cannot be used to delete documents from the index then. " sounded like a match, but I checked that and the IndexWriter is definitely closed. Regards, Eric Chhabra, Kapil wrote: > > Hi, > Checkout for the following lines in the documentation of IndexReader: > > * "An IndexReader can be opened on a directory for which an IndexWriter > is opened already, but it cannot be used to delete documents from the > index then. " > * "Once a document is deleted it will not appear in TermDocs or > TermPostitions enumerations. Attempts to read its field with the > document(int) method will result in an error. The presence of this > document may still be reflected in the > docFreq(org.apache.lucene.index.Term) statistic, though this will be > corrected eventually as the index is further modified." > > Hope this helps. > > Regards, > kapilChhabra > > > -----Original Message----- > From: flateric [mailto:eballnath@yahoo.de] > Sent: Monday, November 19, 2007 3:46 AM > To: java-user@lucene.apache.org > Subject: neither IndexWriter nor IndexReader would delete documents > > > Hallo *; > > I went through some examples of the Lucene in Action book to find that > the API has changed and then applied the corrections with the help of > this forum. > One runtime problem however remains. I cannot delete any documents. > I store documents like this: > > IndexWriter iw = new IndexWriter( > new File(Constants.INDEX_FILENAME), new StandardAnalyzer()); > Document document = new Document(); ... > document.add(new Field("doc", doc, Field.Store.YES, Field.Index.NO)); > iw.addDocument(document); iw.optimize(); iw.close(); > > Which works fine. But deleting them like this: > > Directory fsDir = FSDirectory.getDirectory(new File( > Constants.INDEX_FILENAME)); > IndexReader ir = IndexReader.open(fsDir); ir.deleteDocuments(new > Term("uid", uid)); ir.close(); > > Has absolutely no effect. I also tried delete on the IndexWriter - no > effect. > Please help! I don't know where to investigate any further! > > Thx Eric > -- > View this message in context: > http://www.nabble.com/neither-IndexWriter-nor-IndexReader-would-delete-d > ocuments-tf4832123.html#a13824599 > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > 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 > > > -- View this message in context: http://www.nabble.com/neither-IndexWriter-nor-IndexReader-would-delete-documents-tf4832123.html#a13833730 Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org