: I want a couple of costly queries to be cached at all times in the : queryResultCache. (unless I have a new searcher of course)
first off: you can ensure that certain queries are in the cache, even if there is a newSearcher, just configure a newSearcher Event Listener that forcibly warms the queries you care about. (this is particularly handy to ensure FieldCache gets populated before any user queries are processed) Second: if i understand correctly, you want a way to put an object in the cache, and garuntee that it's always in the cache, even if other objects are more frequetnly used or more recently used? that's kind of a weird use case ... can you elaborate a little more on what exactly your end goal is? the most straightforward approach i can think of would be a new cache implementation that "permenantly" stores the first N items you put in it. that in combination with the newSearcher warming i described above should work. : 1. use User/Generic-cache. This would result in seperate coding-path in : application which I would like to avoid. : 2. exend LRU-cache, and extend request-handler so that a query can be : extended with a parameter indicating that it should be cached at all times. : However, this seems like a lot of cluttering-up these interfaces, for a : relatively small change. #1 wouldn't really accomplish what you want without #2 as well. -Hoss