lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: indexwriter and index searcher
Date Mon, 24 Oct 2005 14:39:02 GMT

On 24 Oct 2005, at 10:07, Dan Adams wrote:
> If I have a directory open and I open an index writer and add a  
> document
> do I have to close the directory and re-open it before I can open a
> searcher and have the new document be included in the search?


> In general, is it good to keep the directory open or is it better to
> open the document each time you need a searcher or writer or  
> something.

In general it all depends :)

But, it is best to keep IndexSearcher cached over multiple searches  
and only recreate it when the index changes and you need to reflect  
those changes with future searches.


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

View raw message