RemoteCachingWrapperFilter.javaAPI DocApache Lucene 2.2.02166Sat Jun 16 22:20:34 BST


public class RemoteCachingWrapperFilter extends Filter
Provides caching of {@link Filter}s themselves on the remote end of an RMI connection. The cache is keyed on Filter's hashCode(), so if it sees the same filter twice it will reuse the original version.

NOTE: This does NOT cache the Filter bits, but rather the Filter itself. Thus, this works hand-in-hand with {@link CachingWrapperFilter} to keep both file Filter cache and the Filter bits on the remote end, close to the searcher.


To cache a result you must do something like RemoteCachingWrapperFilter f = new RemoteCachingWrapperFilter(new CachingWrapperFilter(myFilter));

Matt Ericson

Fields Summary
protected Filter
Constructors Summary
public RemoteCachingWrapperFilter(Filter filter)

    this.filter = filter;
Methods Summary
public java.util.BitSetbits(org.apache.lucene.index.IndexReader reader)
Uses the {@link FilterManager} to keep the cache for a filter on the searcher side of a remote connection.

reader the index reader for the Filter
the bitset

    Filter cachedFilter = FilterManager.getInstance().getFilter(filter);
    return cachedFilter.bits(reader);