lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Uwe Schindler <>
Subject Re: CachingWrapperFilter use
Date Sat, 08 Jan 2011 02:44:46 GMT
That's exactly how its intended to work!


"entdeveloper" <> schrieb:

>Oook. So I think I figured this out: the CachingWrapperFilter isn't
>intended to be used dynamically (i.e. the wrapped filter changes for
>search). It's only really useful if the same filter is being used every
>(e.g. filter type=movies for a movie search site).
>Am I getting that right?
>I guess what I need is something like Solr's filter cache, where
>based on repeated search criteria are retrieved from the cache. Has
>written something like this and used filters in this way before?
>I have a search where one of the criteria is a location (New York, Los
>Angeles, Chicago). I want to put this term in a filter, so that every
>subsequent request for one of those locations is pulled from a cache
>better performance.
>entdeveloper wrote:
>> How is the CachingWrapperFilter intended to be used in a web
>> where new requests come in to be executed? Each time a search comes
>in, I
>> create a filter and then wrap it with a new instance of the
>> CachingWrapperFilter (to cache searches when requests for the same
>> comes in) like so:
>> TopDocs search(String input) {
>>   Term term = new Term("name", input);
>>   Filter filter = new CachingWrapperFilter(new PrefixFilter(term));
>>   return MatchAllDocsQuery(), filter, 10,
>> }
>> So if my understanding is correct, given the javadoc and example in
>> 'Lucene in Action', this won't actually cache anything because each
>time a
>> new request comes in, a new instance of CachingWrapperFilter is being
>> used. I'm a little confused as to how CachingWrapperFilter is to be
>> otherwise. Can anyone help?
>View this message in context:
>Sent from the Lucene - General mailing list archive at

Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen

View raw message