Package org.apache.lucene.search.join
Class TermsWithScoreCollector<DV>
java.lang.Object
org.apache.lucene.search.SimpleCollector
org.apache.lucene.search.join.DocValuesTermsCollector<DV>
org.apache.lucene.search.join.TermsWithScoreCollector<DV>
- All Implemented Interfaces:
Collector
,GenericTermsCollector
,LeafCollector
- Direct Known Subclasses:
TermsWithScoreCollector.MV
,TermsWithScoreCollector.SV
abstract class TermsWithScoreCollector<DV>
extends DocValuesTermsCollector<DV>
implements GenericTermsCollector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
(package private) static class
Nested classes/interfaces inherited from class org.apache.lucene.search.join.DocValuesTermsCollector
DocValuesTermsCollector.Function<R>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BytesRefHash
private static final int
(package private) final ScoreMode
(package private) Scorable
(package private) float[]
Fields inherited from class org.apache.lucene.search.join.DocValuesTermsCollector
docValues
-
Constructor Summary
ConstructorsConstructorDescriptionTermsWithScoreCollector
(DocValuesTermsCollector.Function<DV> docValuesCall, ScoreMode scoreMode) -
Method Summary
Modifier and TypeMethodDescription(package private) static TermsWithScoreCollector<?>
Chooses the rightTermsWithScoreCollector
implementation.float[]
Indicates what features are required from the scorer.void
Called before successive calls toLeafCollector.collect(int)
.Methods inherited from class org.apache.lucene.search.join.DocValuesTermsCollector
doSetNextReader, sortedDocValues, sortedSetDocValues
Methods inherited from class org.apache.lucene.search.SimpleCollector
collect, getLeafCollector
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.Collector
getLeafCollector, setWeight
Methods inherited from interface org.apache.lucene.search.LeafCollector
competitiveIterator
-
Field Details
-
INITIAL_ARRAY_SIZE
private static final int INITIAL_ARRAY_SIZE- See Also:
-
collectedTerms
-
scoreMode
-
scorer
Scorable scorer -
scoreSums
float[] scoreSums
-
-
Constructor Details
-
TermsWithScoreCollector
TermsWithScoreCollector(DocValuesTermsCollector.Function<DV> docValuesCall, ScoreMode scoreMode)
-
-
Method Details
-
getCollectedTerms
- Specified by:
getCollectedTerms
in interfaceGenericTermsCollector
-
getScoresPerTerm
public float[] getScoresPerTerm()- Specified by:
getScoresPerTerm
in interfaceGenericTermsCollector
-
setScorer
Description copied from interface:LeafCollector
Called before successive calls toLeafCollector.collect(int)
. Implementations that need the score of the current document (passed-in toLeafCollector.collect(int)
), should save the passed-in Scorer and call scorer.score() when needed.- Specified by:
setScorer
in interfaceLeafCollector
- Overrides:
setScorer
in classSimpleCollector
- Throws:
IOException
-
create
static TermsWithScoreCollector<?> create(String field, boolean multipleValuesPerDocument, ScoreMode scoreMode) Chooses the rightTermsWithScoreCollector
implementation.- Parameters:
field
- The field to collect terms formultipleValuesPerDocument
- Whether the field to collect terms for has multiple values per document.- Returns:
- a
TermsWithScoreCollector
instance
-
scoreMode
Description copied from interface:Collector
Indicates what features are required from the scorer.
-