Class FilteredQuery.RandomAccessFilterStrategy
A FilteredQuery.FilterStrategy that conditionally uses a random access filter if the given DocIdSet supports random access (returns a non-null value from Bits) and UseRandomAccess(IBits, int) returns
true
. Otherwise this strategy falls back to a "zig-zag join" (
LEAP_FROG_FILTER_FIRST_STRATEGY) strategy .
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class FilteredQuery.RandomAccessFilterStrategy : FilteredQuery.FilterStrategy
Methods
FilteredScorer(AtomicReaderContext, Weight, DocIdSet)
Returns a filtered Scorer based on this strategy.
Declaration
public override Scorer FilteredScorer(AtomicReaderContext context, Weight weight, DocIdSet docIdSet)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | the AtomicReaderContext for which to return the Scorer. |
Weight | weight | the FilteredQueryWeight to create the filtered scorer. |
DocIdSet | docIdSet | the filter DocIdSet to apply |
Returns
Type | Description |
---|---|
Scorer | a filtered scorer |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | if an IOException occurs |
UseRandomAccess(IBits, int)
Expert: decides if a filter should be executed as "random-access" or not. Random-access means the filter "filters" in a similar way as deleted docs are filtered in Lucene. This is faster when the filter accepts many documents. However, when the filter is very sparse, it can be faster to execute the query+filter as a conjunction in some cases.
The default implementation returnstrue
if the first document accepted by the
filter is < 100.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
protected virtual bool UseRandomAccess(IBits bits, int firstFilterDoc)
Parameters
Type | Name | Description |
---|---|---|
IBits | bits | |
int | firstFilterDoc |
Returns
Type | Description |
---|---|
bool |