lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <morus.wal...@tanto-xipolis.de>
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?

Morus


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message