lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aviran" <amo...@infosciences.com>
Subject RE: best ways of using IndexSearcher
Date Wed, 17 Nov 2004 14:56:54 GMT
Yes, IndexSearcher is thread safe.

Aviran
http://www.aviransplace.com

-----Original Message-----
From: Abhay Saswade [mailto:ays@i.frys.com] 
Sent: Tuesday, November 16, 2004 15:16 PM
To: Lucene Users List
Subject: Re: best ways of using IndexSearcher


Hello,
Can I use single instance of IndexSearcher in multiple threads with sorting?
Thanks, Abhay

----- Original Message ----- 
From: "Otis Gospodnetic" <otis_gospodnetic@yahoo.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Monday, June 28, 2004 8:51 PM
Subject: Re: best ways of using IndexSearcher


> Anson,
>
> Use a single instance of IndexSearcher and, if you want to always 
> 'see' even the latest index changes (deletes and adds since you opened 
> the
> IndexSearcher) make sure to re-create the IndexSearcher when you detect
> that the index version has changed (see
>
http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/index/IndexReade
r.html#getCurrentVersion(org.apache.lucene.store.Directory))
>
> When you get the new IndexSearcher, leave the old instance alone - let 
> the GC take care of it, and don't call close() on it, in case 
> something in your application is still using that instance.
>
> This stuff is not really CPU intensive.  Disk I/O tends to be the 
> bottleneck.  If you are working with multiple indices, spread them 
> over multiple disks (not just partitions, real disks), if you can.
>
> Otis
>
>
> --- Anson Lau <alau@fulfil-net.com> wrote:
> > Hi Guys,
> >
> > What's the recommended way of using IndexSearcher? Should 
> > IndexSearcher be a singleton or pooled?  Would pooling provide a 
> > more scalable solution by
> > allowing you to decide how many IndexSearcher to use based on say how
> > many
> > CPU u have on ur server?
> >
> > Thanks,
> >
> > Anson
>
>
> ---------------------------------------------------------------------
> 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



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