If you have access to the server (i.e. not a shared hosting
environment), I've been happy with running Lucene as a Windows Service
and accessing it from ASP.NET (w/WCF).  The service uses the
RAMdirectory to handle queries (Lucene's indexes are pretty small, and
can fit into RAM easily) and updates are handled to an FSDirectory.
After the updates are done, I just reload the RAMDirectory from the
file system's version.

It all depends on your specific setup, but the above has been running
smoothly for months now (intranet of 2000 users).

Mike

On Mon, Oct 13, 2008 at 11:35 AM, Doug Sale <[EMAIL PROTECTED]> wrote:
> 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?
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>>
>>
>

Reply via email to