lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Ho <sebasti...@bii.a-star.edu.sg>
Subject Re: indexreader throwing IOException with lock obtain timed out
Date Mon, 31 May 2004 10:12:44 GMT
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


Mime
View raw message