lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: "Best-practice" in a web application
Date Tue, 20 Sep 2005 10:49:48 GMT

On Sep 20, 2005, at 2:24 AM, Magne Skjeret wrote:
> I am using lucene to index all my data, and it is working just great.
> I will now add search to a web application, so the index can  
> actually be
> used, not just sit there.

Good idea... it'd be a shame for the index to sit unsearched!  :)

> 1. Can a search be performed while the index is beeing updated (add/ 
> delete)?

Yes, no problem with searches occurring during add/delete  
operations.  The searches will not see new documents and still return  
deleted documents until a new IndexSearcher instance is used, though.

> 2. Should I create a IndexSearcher for each search?
>    Or should I have 1 IndexSearcher for everyone? If, it is  
> threadsafe,
> or do I queue? Or should I create a pool of IndexSearchers?

For best performance, use a single IndexSearcher instance across your  
entire application.

> 3. Do I need to close the IndexSearcher while or after a index update
> operation?

When you want index changes to be visible to searches, drop the old  
IndexSearcher instance and instantiate a new one.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message