lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <>
Subject Re: best way of reusing IndexSearcher objects
Date Thu, 18 Dec 2003 09:58:08 GMT
Some time ago (Nov 5) Otis suggested to use one IndexSearcher instance for
search and recreate this instance when the index changed:

> Use a single instance of IndexSearcher.
> When you detect that the index has changed, through that instance (see
> javadoc for the exact method name, I don't recall its exact name now),
> discard that instance, and make a new one.

My problem is that I don't find an apropriate method in the javadoc.
Do I miss something?

There are static methods 'lastModified' in the IndexReader class.
So one might use these (together with a timestamp, when the IndexSearcher
was opened) to do the check.

But it would be nice to have some 'isUpToDate' method in the class itself.
Or should I do that myself by subclassing IndexSearcher?


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

View raw message