OK, got it. Thanks.

On 5/23/06, Erik Hatcher <[EMAIL PROTECTED]> wrote:


On May 21, 2006, at 10:56 PM, Zhenjian YU wrote:
> I didn't dig the source code of lucence deep enough, but I noticed
> that the
> IndexSearcher uses an IndexReader, while the cost of initializing
> IndexReader is a bit high.

The key is the IndexReader.

> My application is a webapp, so I think it may be good if I cache some
> instances of IndexSearcher to provide service for my webapp. I
> haven't done
> any performance testing yet. Maybe I test it later to see the
> difference
> between caching and without caching.

It is best to keep only a single IndexSearcher/IndexReader
combination around.  There is no need to have more than one instance,
and in fact it is a waste of resources to do so.

        Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to