lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From entdeveloper <cameron.develo...@gmail.com>
Subject CachingWrapperFilter use
Date Fri, 07 Jan 2011 00:57:39 GMT

How is the CachingWrapperFilter intended to be used in a web environment
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 input
comes in) like so:

TopDocs search(String input) {
  Term term = new Term("name", input);
  Filter filter = new CachingWrapperFilter(new PrefixFilter(term));

  return indexSearcher.search(new MatchAllDocsQuery(), filter, 10, null);
}

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 used otherwise.
Can anyone help?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/CachingWrapperFilter-use-tp2209175p2209175.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message