You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "M. Mokotov" <mk...@mokotov.org> on 2005/06/02 17:56:19 UTC
RE: using the CachingWrapperFilter
Hi Erik,
Thank you very much for your reply.
The problem is I need only the caching without any date or query
functionality.
Since the only two constructable-without-wrapping Filters are the
QueryFilter and DateFilter, I need either to have a dummy filter, or to have
a constructor for the CachingWrapperFilter that doesn't wrap (meaning a
constructor that doesn't get a filter as a parameter).
Am I missing something?
Regards,
Mickey.
-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
Sent: Thursday, May 26, 2005 2:52 PM
To: java-user@lucene.apache.org
Subject: Re: using the CachingWrapperFilter
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: using the CachingWrapperFilter
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 2, 2005, at 11:56 AM, M. Mokotov wrote:
> Hi Erik,
>
> Thank you very much for your reply.
>
> The problem is I need only the caching without any date or query
> functionality.
> Since the only two constructable-without-wrapping Filters are the
> QueryFilter and DateFilter, I need either to have a dummy filter,
> or to have
> a constructor for the CachingWrapperFilter that doesn't wrap
> (meaning a
> constructor that doesn't get a filter as a parameter).
>
> Am I missing something?
One of us is missing something, that's for sure! :) I'm not at all
understanding what it is you want to cache at this point.
Please elaborate on what you're trying to do.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org