Anson, I was indeed referring to search, but I could be wrong. I have not tested it, so my answer was more instinctive than scientific. :( Regardless, a single IndexSearcher should do. Are you finding that your queries are taking too long? If so, I suggest you profile things, and find the bottleneck. One person has recently provided some execution stack traces, which revealed 1 bottleneck, and I believe Doug has subsequently applied a patch that improved search performance.
Otis --- Anson Lau <[EMAIL PROTECTED]> wrote: > Otis, > > Thanks for the advice. When you say "This stuff is not really CPU > intensive" are you refering to the search itself or something else? > In my > experience the search tends to be ultimately bounded by CPU. > > Anson > > -----Original Message----- > From: Otis Gospodnetic [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 2:51 PM > To: Lucene Users List > 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]