public abstract class RandomAccessWeight extends ConstantScoreWeight
Weight
s that are based on random-access
structures such as live docs or doc values. Such weights return a
Scorer
which consists of an approximation that matches
everything, and a confirmation phase that first checks live docs and
then the Bits
returned by getMatchingDocs(LeafReaderContext)
.Weight.DefaultBulkScorer
parentQuery
Modifier | Constructor and Description |
---|---|
protected |
RandomAccessWeight(Query query)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Bits |
getMatchingDocs(LeafReaderContext context)
Return a
Bits instance representing documents that match this
weight on the given context. |
Scorer |
scorer(LeafReaderContext context)
Returns a
Scorer which can iterate in order over all matching
documents and assign them a score. |
boost, explain, extractTerms, getValueForNormalization, normalize, queryNorm, score
bulkScorer, getQuery
protected RandomAccessWeight(Query query)
protected abstract Bits getMatchingDocs(LeafReaderContext context) throws IOException
Bits
instance representing documents that match this
weight on the given context. A return value of null
indicates
that no documents matched.
Note: it is not needed to care about live docs as they will be checked
before the returned bits.IOException
public final Scorer scorer(LeafReaderContext context) throws IOException
Weight
Scorer
which can iterate in order over all matching
documents and assign them a score.
NOTE: null can be returned if no documents will be scored by this query.
NOTE: The returned Scorer
does not have
LeafReader.getLiveDocs()
applied, they need to be checked on top.
scorer
in class Weight
context
- the LeafReaderContext
for which to return the Scorer
.Scorer
which scores documents in/out-of order.IOException
- if there is a low-level I/O errorCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.