lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vasu shah <>
Subject Re: IndexReader / IndexWriter Synchronization
Date Tue, 25 Jul 2006 16:44:37 GMT
Thanks Mike. Your explanation was really helpful. 
  I would use the IndexModifier class till the new IndexWriter class comes up.
  Thanks once again.

Michael McCandless <> wrote:
  > 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:

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min
or less.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message