You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Stefano Buliani <st...@fastwebnet.it> on 2005/06/06 11:11:15 UTC

searches and updates concurrency problem

Hi everyone,
I'm a newbie of Lucene, just installed it.
My problem is that the index update procedure and the searches could run
simultaneously, and, if they do, they corrupt the index file.
Is there a way to let Lucene handle this concurrency automatically (like
stop the searches till the update is finished)?
Thanks,
	Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: searches and updates concurrency problem

Posted by Daniel Naber <lu...@danielnaber.de>.
On Monday 06 June 2005 11:11, Stefano Buliani wrote:

> My problem is that the index update procedure and the searches could run
> simultaneously, and, if they do, they corrupt the index file.

Search is a read-only thing, so why should it corrupt the index? Even 
having several writers at the same time will not corrupt the index, you'll 
get an IOException because of the lock files instead.

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: searches and updates concurrency problem

Posted by Aalap Parikh <al...@yahoo.com>.
Hi,

As per my understanding of Lucene, I think concurrent
search and update to an index should not corrupt the
index, given that only a single index-modifying
operation is executing at any point of time. So in
short, you can have multiple search operations and not
more than one index update (add and/or delete)
operation in progress at any time and that should not
corrupt the index.


Thanks,
Aalap.
 
--- Maik Schreiber
<bl...@blizzy.de> wrote:

> > My problem is that the index update procedure and
> the searches could run
> > simultaneously, and, if they do, they corrupt the
> index file.
> > Is there a way to let Lucene handle this
> concurrency automatically (like
> > stop the searches till the update is finished)?
> 
> Lucene does not handle this by itself but relies on
> outside synchronization.
> You might want to have a look at LuceneIndexAccessor
> (please see
>
http://issues.apache.org/bugzilla/show_bug.cgi?id=34995)
> 
> -- 
> Maik Schreiber   *   http://www.blizzy.de
> 
> GPG public key:
>
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x1F11D713
> Key fingerprint: CF19 AFCE 6E3D 5443 9599 18B5 5640
> 1F11 D713
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail:
> java-user-help@lucene.apache.org
> 
> 



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: searches and updates concurrency problem

Posted by Maik Schreiber <bl...@blizzy.de>.
> My problem is that the index update procedure and the searches could run
> simultaneously, and, if they do, they corrupt the index file.
> Is there a way to let Lucene handle this concurrency automatically (like
> stop the searches till the update is finished)?

Lucene does not handle this by itself but relies on outside synchronization.
You might want to have a look at LuceneIndexAccessor (please see
http://issues.apache.org/bugzilla/show_bug.cgi?id=34995)

-- 
Maik Schreiber   *   http://www.blizzy.de

GPG public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x1F11D713
Key fingerprint: CF19 AFCE 6E3D 5443 9599 18B5 5640 1F11 D713

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: searches and updates concurrency problem

Posted by Thomas Plümpe <th...@gmx.de>.
Thanks Stefano,

well done. It's not for sure that the concurrently running
updates and searches do corrupt the index (a full update that
removes the files and rebuilds them can obviously do so), but
I'm sure they'll get the point and will tell us how things like
that are handled.

Best,
Thomas


> --- Ursprüngliche Nachricht ---
> Von: Stefano Buliani <st...@fastwebnet.it>
> An: java-user@lucene.apache.org
> Betreff: searches and updates concurrency problem
> Datum: Mon, 06 Jun 2005 10:11:15 +0100
> 
> Hi everyone,
> I'm a newbie of Lucene, just installed it.
> My problem is that the index update procedure and the searches could run
> simultaneously, and, if they do, they corrupt the index file.
> Is there a way to let Lucene handle this concurrency automatically (like
> stop the searches till the update is finished)?
> Thanks,
> 	Stefano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org