lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Extending Sort/FieldCache
Date Thu, 03 Sep 2009 22:15:34 GMT

: I wanted to avoid two things:
: * Writing the logic that invokes cache-refresh upon IndexReader reload.

Uh... i don't think there is any code that FieldCache refreshing on 
reload (yet), so you wouldn't be missing out on anything.  (as long as 
your custom cache works at the SegmentReader level, you'd have the exact 
same benefits as using FieldCache)

: * Write my own TopFieldCollector which uses this cache.

well, yeah ... there you're screwed.

you know ... just because FieldCache.DEFAULT is a static final singleton, 
doesn't mean we need to have FieldCache.DEFAULT hardcoded in so many 
places ... a lot of the high level classes that refer to 
FieldCache.DEFAULT could probably be refacotred to have a 
setFieldCache(FieldCache) method that defaults to FieldCache.DEFAULT, and 
then they could pass it down to the lower level classes ... that way you 
*could* write a "MyFieldCache extends FieldCache", and then have a 
SortComparator (or FieldComparator, or whatever it's called now) that cast 
the FieldCache it gets to your MyFieldCache and calls the custom methods 
... withoutneeding to rewrite all of hte Collector code.

It sounds a little invasive to make it into 2.9 ... but i haven't looked 
ito what it would involve ... in theory it could be really straight 
forward and backwards compatible.


-Hoss


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


Mime
View raw message