Package org.apache.lucene.search
Class FilteredQuery.RandomAccessFilterStrategy
java.lang.Object
org.apache.lucene.search.FilteredQuery.FilterStrategy
org.apache.lucene.search.FilteredQuery.RandomAccessFilterStrategy
- Enclosing class:
FilteredQuery
A
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, int) returns
true. Otherwise this strategy falls back to a "zig-zag join" (
FilteredQuery.LEAP_FROG_FILTER_FIRST_STRATEGY) strategy .-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilteredScorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Weight weight, DocIdSet docIdSet) Returns a filteredScorerbased on this strategy.
-
Constructor Details
-
RandomAccessFilterStrategy
public RandomAccessFilterStrategy()
-
-
Method Details
-
filteredScorer
public Scorer filteredScorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Weight weight, DocIdSet docIdSet) throws IOException Description copied from class:FilteredQuery.FilterStrategyReturns a filteredScorerbased on this strategy.- Specified by:
filteredScorerin classFilteredQuery.FilterStrategy- Parameters:
context- theAtomicReaderContextfor which to return theScorer.scoreDocsInOrder- specifies whether in-order scoring of documents is required. Note that if set to false (i.e., out-of-order scoring is required), this method can return whatever scoring mode it supports, as every in-order scorer is also an out-of-order one. However, an out-of-order scorer may not supportDocIdSetIterator.nextDoc()and/orDocIdSetIterator.advance(int), therefore it is recommended to request an in-order scorer if use of these methods is required.topScorer- if true,Scorer.score(Collector)will be called; if false,DocIdSetIterator.nextDoc()and/orDocIdSetIterator.advance(int)will be called.weight- theFilteredQueryWeightto create the filtered scorer.docIdSet- the filterDocIdSetto apply- Returns:
- a filtered scorer
- Throws:
IOException- if anIOExceptionoccurs
-