lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: best way of reusing IndexSearcher objects
Date Thu, 18 Dec 2003 11:29:10 GMT
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 <morus.walter@tanto-xipolis.de> 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: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


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

---------------------------------------------------------------------
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