How you handle lifecycle issues depends on your requirements. The simplest thing to do is to create/destroy your application's IndexWriter and IndexSearcher within the lifecycle hooks of the application container.
You may also choose to pool IndexWriter and IndexSearcher (even though there is likely only one IndexWriter and possibly only one IndexSearcher). You can utilize the hooks of the pooling mechanism to ensure the health of your IndexWriter and IndexSearcher(s) instances. -Doug On Sat, Oct 11, 2008 at 4:47 PM, Corey Trager <[EMAIL PROTECTED]> wrote: > In the sample code, and my code, I see that there's a call to "Close" on > IndexSearcher. Should I > omit that call, and leave it always open? > > > --- Digy <[EMAIL PROTECTED]> wrote: > > > Yes Lucene has build-in concurrency management. You can freely search and > > update the same index in different threads. One point here is that you > have > > to use the same instance of the IndexWriter in updating threads. Trying > to > > open the same index twice will throw exception. It is also recommended to > > share a single IndexSearcher across threads for better performance. > > > > DIGY > > > > -----Original Message----- > > From: Corey Trager [mailto:[EMAIL PROTECTED] > > Sent: Saturday, October 11, 2008 7:36 PM > > To: lucene-net-user@incubator.apache.org > > Subject: Multiple threads updating/reading the same index in an ASP.NET > > website. > > > > Does Lucene.Net have built into it logic for managing concurrency, > multiple > > threads? If a > > request comes to my website that triggers a thread to update the index, > and > > another request comes > > on another thread that also triggers a request to update, or even read, > the > > index, does Lucene > > handle the management of concurrency, or do I need to? > > > > > > > > > > > > > > >