Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 51735 invoked from network); 31 May 2004 10:14:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 31 May 2004 10:14:49 -0000 Received: (qmail 32991 invoked by uid 500); 31 May 2004 10:14:35 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 32895 invoked by uid 500); 31 May 2004 10:14:33 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 32798 invoked by uid 99); 31 May 2004 10:14:28 -0000 Received: from [202.6.243.8] (HELO smtp.bii-sg.org) (202.6.243.8) by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 31 May 2004 03:14:28 -0700 Received: (qmail 10723 invoked from network); 31 May 2004 10:14:05 -0000 Received: from ip7-86-v366.it-group.bii (HELO ?10.217.7.86?) (10.217.7.86) by apps1.bii-sg.org with SMTP; 31 May 2004 10:14:05 -0000 Subject: Re: indexreader throwing IOException with lock obtain timed out From: Sebastian Ho To: Lucene Users List In-Reply-To: <1085997751.2751.13.camel@localhost.localdomain> References: <1085997751.2751.13.camel@localhost.localdomain> Content-Type: text/plain Organization: Message-Id: <1085998363.2751.17.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 31 May 2004 18:12:44 +0800 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Sorry guys I have solved it. I should do this. int deleteDoc = 0; IndexReader reader = IndexReader.open(dstDir); deleteDoc = reader.delete(new Term("url", url)); reader.close(); Just need to use the same instance of reader. anyway lucene should just overwrite the old document during updating instead.. sebastian On Mon, 2004-05-31 at 18:02, Sebastian Ho wrote: > hi > > i am updating the index and therefore need to delete documents before > adding the updated version. > > This is how I delete the document which is working fine. > > ----------------------------------------------------------------- > int deleteDoc = 0; > deleteDoc = IndexReader.open(dstDir).delete(new Term("url", url)); > IndexReader.open(dstDir).close(); > ----------------------------------------------------------------- > > The writer after that throws an IOException : Lock obtain timed out. > > ----------------------------------------------------------------- > Analyzer analyzer = new StandardAnalyzer(); > IndexWriter writer = new IndexWriter(dstDir, analyzer, overwrite); > ----------------------------------------------------------------- > > Am I missing anything? I have already closed the IndexReader before > calling the writer. > > Thanks > > > Sebastian > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org