lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: IndexReader / IndexWriter Synchronization
Date Tue, 25 Jul 2006 16:17:32 GMT
>   I am not very good at threading. So I was looking if there is any api class (even in
nightly builds) on top of the IndexReader/IndexWriter that takes care of concurrency rules.

This is exactly why IndexModifier was created (so you wouldn't have to 
worry about the details of closing/opening IndexReader/IndexWriter). 
There is also additional locking under the hood of those two classes 
that is abstracting away concurrency details so you don't have to worry 
about them.

>   Every developer must be facing this problem of concurrency while programming.

Definitely.  This is indeed one of the common sources of confusion about 
Lucene: the fact that you have to carefully open/close these two classes 
to do common operations is odd; the fact that you need an IndexReader to 
do deletes is "unexpected" (one would expect IndexWriter to do that).

There is work underway to enable IndexWriter to [efficiently] handle 
deletes -- there's been alot of lively discussion on lucene-dev & 
several iterations on possible patches -- see here:

But this is very much "in process" now.  I don't know of anything else 
in the nightly builds (since 2.0) that address these issues yet.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message