On 9/11/06, David Wennergren <david.wennergren at gmail.com>
wrote:> I''m trying to use a DateFilter to speed up some searches. The
situation
> is that a have an index with 200 000+ documents and I want to run a few
> thousand alerts (basically stored searches) on only a small portion of
> the index (documents added the last hour).
>
> Is datefilter the best solution for the situation described above?
>
> I assumed that the datefilter would be cached in the same way as a
> QueryFilter. But as far as I can tell from my tests that isn''t the
> case... I read an example in the "Lucene in action"-book that
seemed to
> suggest to use a CachingWrapperFilter in combination with a DateFilter
> to get the benefits of caching. How is this done in Ferret?
>
> I''m using ferret 0.9.6 and acts_as_ferret
>
> Thanks a lot!
>
> /David Wennergren
Hi David,
Firstly, use a RangeFilter instead of a DateFilter. And, yes, it
should be the best solution for the situation described. See the
documentation here;
http://ferret.davebalmain.com/api/
It is very simple to use. As far as caching goes, all filters in
Ferret get cached but the bitvector cache gets garbage collected when
the filter is garbage collected.
Would it be possible for you to show me what you were doing when the
bitvector wasn''t getting cached. I''m curious to see how you
went about
solving the problem.
Cheers,
Dave