You could subclass IndexSearcher like you said.  You could patch
IndexSearcher by adding this method.  You could also change the search
method to do this check automatically.  You could also add
setAutoRefresh(boolean) method to IndexSearcher and then to automatic
refresh only if this was set to true (default could remain false, for
backward compatibility).

diff -u patcher in Bugzilla are very welcome! :)

Otis


--- Morus Walter <[EMAIL PROTECTED]> wrote:
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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

Reply via email to