java.lang.Object
org.apache.lucene.search.Weight
org.apache.lucene.search.ConstantScoreWeight
- All Implemented Interfaces:
SegmentCacheable
- Direct Known Subclasses:
AbstractMultiTermQueryConstantScoreWrapper.RewritingWeight
,GlobalOrdinalsQuery.W
,LRUQueryCache.CachingWrapperWeight
A Weight that has a constant score equal to the boost of the wrapped query. This is typically
useful when building queries which do not produce meaningful scores and are mostly useful for
filtering.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.Weight
Weight.DefaultBulkScorer, Weight.DefaultScorerSupplier
-
Field Summary
FieldsFields inherited from class org.apache.lucene.search.Weight
parentQuery
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexplain
(LeafReaderContext context, int doc) An explanation of the score computation for the named document.protected final float
score()
Return the score produced by thisWeight
.Methods inherited from class org.apache.lucene.search.Weight
bulkScorer, count, getQuery, matches, scorer, scorerSupplier
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.SegmentCacheable
isCacheable
-
Field Details
-
score
private final float score
-
-
Constructor Details
-
ConstantScoreWeight
-
-
Method Details
-
score
protected final float score()Return the score produced by thisWeight
. -
explain
Description copied from class:Weight
An explanation of the score computation for the named document.- Specified by:
explain
in classWeight
- Parameters:
context
- the readers context to create theExplanation
for.doc
- the document's id relative to the given context's reader- Returns:
- an Explanation for the score
- Throws:
IOException
- if anIOException
occurs
-