Package org.apache.lucene.search
Class ConstantScoreWeight
- java.lang.Object
- 
- org.apache.lucene.search.Weight
- 
- org.apache.lucene.search.ConstantScoreWeight
 
 
- 
- All Implemented Interfaces:
- SegmentCacheable
 
 public abstract class ConstantScoreWeight extends Weight 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.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.lucene.search.WeightWeight.DefaultBulkScorer
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.lucene.search.WeightparentQuery
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedConstantScoreWeight(Query query, float score)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Explanationexplain(LeafReaderContext context, int doc)An explanation of the score computation for the named document.protected floatscore()Return the score produced by thisWeight.- 
Methods inherited from class org.apache.lucene.search.WeightbulkScorer, count, getQuery, matches, scorer, scorerSupplier
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.lucene.search.SegmentCacheableisCacheable
 
- 
 
- 
- 
- 
Constructor Detail- 
ConstantScoreWeightprotected ConstantScoreWeight(Query query, float score) 
 
- 
 - 
Method Detail- 
scoreprotected final float score() Return the score produced by thisWeight.
 - 
explainpublic Explanation explain(LeafReaderContext context, int doc) throws IOException Description copied from class:WeightAn explanation of the score computation for the named document.- Specified by:
- explainin class- Weight
- Parameters:
- context- the readers context to create the- Explanationfor.
- doc- the document's id relative to the given context's reader
- Returns:
- an Explanation for the score
- Throws:
- IOException- if an- IOExceptionoccurs
 
 
- 
 
-