lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: IndexSearcher usage and caching?
Date Mon, 12 Jul 2004 14:26:58 GMT
Cache/reuse your IndexSearcher.
On every search, check if the index has changed (there are methods for
If it has changed, create a new IndexSearcher and assign it to your
IndexSearcher variable, and do not close the old IndexSearcher, just in
case something is still using it.


--- Joel Shellman <> wrote:
> I'm working on a document management system using lucene to search 
> through all the documents.
> This means that I'll be adding/updating/deleting documents at the
> same 
> time searches are going on.
> I thought to create an IndexSearcher and reuse it throughout, but
> that 
> doesn't seem to work. If I do a search, then add a document, and do 
> another search with the same IndexSearcher, it won't find the newly 
> added document.
> I'd rather not have to create a new IndexSearcher for every query...
> do 
> I have to?
> Thanks,
> -joel shellman


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

View raw message