On May 26, 2005, at 5:02 AM, M. Mokotov wrote:
Can someone please explain me how do I use the CachingWrapperFilter?
There is a bit of it demonstrated in Lucene in Action. Here are some
snippets that (sort of) describe it:
http://www.lucenebook.com/search?query=CachingWrapperFilter
You can grab the LIA source code from that site also.
I see that it's built in a decorator way (getting on the
constructor another
filter and decorate it with caching), still I don't see any basic
filter to
be the 'root'.
There are two concrete Filters built in to Lucene - QueryFilter and
DateFilter. QueryFilter already has built-in caching, but DateFilter
does not. CachingWrapperFilter was created to separate caching from
the filtering aspects, allowing filters to free themselves from
having to cache themselves.
On the tests I saw there is a MockFilter, but I couldn't find it on
the
jars.
We don't package up the test code as a JAR file - but if you check
out Lucene's code from Subversion you'll find it under src/test
Do I need to create such a filter myself? Does anyone using the
cache needs
to create his own dummy class?
This all depends on what you're trying to do. A Filter is used for
long standing constraints of the document search space. You would
not use a "dummy" class, but rather a real filter such as the ones
just mentioned. And whether you use the CachingWrapperFilter depends
on which filter you choose or if you create a custom one. The Lucene
in Action source code has an example of a custom Filter.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]