lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Caching filter wrapper
Date Mon, 15 Sep 2003 17:58:18 GMT
On Monday, September 15, 2003, at 12:46  PM, Bruce Ritchie wrote:
> Erik Hatcher wrote:
>> So, if there was a caching filter implemented like yours, but with 
>> the WeakHashMap cache like QueryFilter, would you use it instead of 
>> what you've done?
>
> I think it would depend on whether the cache key's are independant of 
> IndexReaders (i.e. an implementation that's not implemented in the 
> same manner as the QueryFilter by using an IndexReader as a cache key 
> (or part thereof). This is because I open multiple IndexReaders 
> against a single index which would cause (false) cache misses. If that 
> wasn't the case then I think I'd be ok with using it, irregardless of 
> my preference to use our own cache architecture. I'd definitely use it 
> if I could provide the backing map via a setMap() method or the like.

Cool.... I'll work on adding an implementation then.  But what would be 
the key to the map if not the IndexReader instance?  It ought to be 
something related to that at least for the scenario's where a single 
filter instance is being used over multiple indices.  Or would simply 
two different constructors be enough (one taking a Filter and 
defaulting to a WeakHashMap, and the other taking a Filter and a Map to 
use), and still use IndexReader as the key?

	Erik


Mime
View raw message