public static class FilteredQuery.RandomAccessFilterStrategy extends FilteredQuery.FilterStrategy
FilteredQuery.FilterStrategy that conditionally uses a random access filter if
the given DocIdSet supports random access (returns a non-null value
from DocIdSet.bits()) and
useRandomAccess(Bits, long) returns
true. Otherwise this strategy falls back to a "zig-zag join" (
FilteredQuery.LEAP_FROG_FILTER_FIRST_STRATEGY) strategy .| Constructor and Description |
|---|
FilteredQuery.RandomAccessFilterStrategy() |
| Modifier and Type | Method and Description |
|---|---|
Scorer |
filteredScorer(LeafReaderContext context,
Weight weight,
DocIdSet docIdSet)
Returns a filtered
Scorer based on this strategy. |
protected boolean |
useRandomAccess(Bits bits,
long filterCost)
Expert: decides if a filter should be executed as "random-access" or not.
|
filteredBulkScorerpublic FilteredQuery.RandomAccessFilterStrategy()
public Scorer filteredScorer(LeafReaderContext context, Weight weight, DocIdSet docIdSet) throws IOException
FilteredQuery.FilterStrategyScorer based on this strategy.filteredScorer in class FilteredQuery.FilterStrategycontext - the LeafReaderContext for which to return the Scorer.weight - the FilteredQuery Weight to create the filtered scorer.docIdSet - the filter DocIdSet to applyIOException - if an IOException occursprotected boolean useRandomAccess(Bits bits, long filterCost)
true if the filter matches more than 1%
of documentsCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.