lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilton, Reece" <Reece.Wil...@dig.com>
Subject RE: Safe to write while optimizing?
Date Tue, 29 Jul 2003 23:37:18 GMT
Thanks for the reply.  

Just to clarify:
You are saying that I can optimize and add a document at the same time
as long as both threads use the same IndexWriter.  Is that correct?

-----Original Message-----
From: Doug Cutting [mailto:cutting@lucene.com] 
Sent: Tuesday, July 29, 2003 2:27 PM
To: Lucene Users List
Subject: Re: Safe to write while optimizing?


Wilton, Reece wrote:
> Three questions:
> - Is it safe to have two IndexWriters open on the same index?

No.  It is not safe, and the code makes every attempt to prohibit it.

> - Is it safe to have two IndexWriters adding a document concurrently?

No, but you can have two threads adding documents to a single 
IndexWriter concurrently.

> - Is it safe to add a document while another IndexWriter is optimizing

> the index?

No, but, so long as you use a single IndexWriter object, synchronization

should handle things correctly so that one thread can add documents 
while another optimizes.

Doug


---------------------------------------------------------------------
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