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 Classes Modifier and Type Class Description (package private) static class
TermsWithScoreCollector.MV
(package private) static class
TermsWithScoreCollector.SV
-
Nested classes/interfaces inherited from class org.apache.lucene.search.join.DocValuesTermsCollector
DocValuesTermsCollector.Function<R>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BytesRefHash
collectedTerms
private static int
INITIAL_ARRAY_SIZE
(package private) ScoreMode
scoreMode
(package private) Scorable
scorer
(package private) float[]
scoreSums
-
Fields inherited from class org.apache.lucene.search.join.DocValuesTermsCollector
docValues
-
-
Constructor Summary
Constructors Constructor Description TermsWithScoreCollector(DocValuesTermsCollector.Function<DV> docValuesCall, ScoreMode scoreMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static TermsWithScoreCollector<?>
create(java.lang.String field, boolean multipleValuesPerDocument, ScoreMode scoreMode)
Chooses the rightTermsWithScoreCollector
implementation.BytesRefHash
getCollectedTerms()
float[]
getScoresPerTerm()
ScoreMode
scoreMode()
Indicates what features are required from the scorer.void
setScorer(Scorable scorer)
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
-
Methods inherited from interface org.apache.lucene.search.LeafCollector
competitiveIterator
-
-
-
-
Field Detail
-
INITIAL_ARRAY_SIZE
private static final int INITIAL_ARRAY_SIZE
- See Also:
- Constant Field Values
-
collectedTerms
final BytesRefHash collectedTerms
-
scoreMode
final ScoreMode scoreMode
-
scorer
Scorable scorer
-
scoreSums
float[] scoreSums
-
-
Constructor Detail
-
TermsWithScoreCollector
TermsWithScoreCollector(DocValuesTermsCollector.Function<DV> docValuesCall, ScoreMode scoreMode)
-
-
Method Detail
-
getCollectedTerms
public BytesRefHash getCollectedTerms()
- Specified by:
getCollectedTerms
in interfaceGenericTermsCollector
-
getScoresPerTerm
public float[] getScoresPerTerm()
- Specified by:
getScoresPerTerm
in interfaceGenericTermsCollector
-
setScorer
public void setScorer(Scorable scorer) throws java.io.IOException
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:
java.io.IOException
-
create
static TermsWithScoreCollector<?> create(java.lang.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
-
-