abstract class TermsWithScoreCollector<DV> extends DocValuesTermsCollector<DV> implements GenericTermsCollector
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
TermsWithScoreCollector.MV |
(package private) static class |
TermsWithScoreCollector.SV |
DocValuesTermsCollector.Function<R>| Modifier and Type | Field and Description |
|---|---|
(package private) BytesRefHash |
collectedTerms |
private static int |
INITIAL_ARRAY_SIZE |
(package private) ScoreMode |
scoreMode |
(package private) Scorer |
scorer |
(package private) float[] |
scoreSums |
docValues| Constructor and Description |
|---|
TermsWithScoreCollector(DocValuesTermsCollector.Function<DV> docValuesCall,
ScoreMode scoreMode) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static TermsWithScoreCollector<?> |
create(java.lang.String field,
boolean multipleValuesPerDocument,
ScoreMode scoreMode)
Chooses the right
TermsWithScoreCollector implementation. |
BytesRefHash |
getCollectedTerms() |
float[] |
getScoresPerTerm() |
boolean |
needsScores()
Indicates if document scores are needed by this collector.
|
void |
setScorer(Scorer scorer)
Called before successive calls to
LeafCollector.collect(int). |
binaryDocValues, coder, doSetNextReader, numericAsBinaryDocValues, sortedNumericAsSortedSetDocValues, sortedSetDocValuescollect, getLeafCollectorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateCollectorMV, createCollectorSV, verbose, wrapgetLeafCollectorprivate static final int INITIAL_ARRAY_SIZE
final BytesRefHash collectedTerms
final ScoreMode scoreMode
Scorer scorer
float[] scoreSums
TermsWithScoreCollector(DocValuesTermsCollector.Function<DV> docValuesCall, ScoreMode scoreMode)
public BytesRefHash getCollectedTerms()
getCollectedTerms in interface GenericTermsCollectorpublic float[] getScoresPerTerm()
getScoresPerTerm in interface GenericTermsCollectorpublic void setScorer(Scorer scorer) throws java.io.IOException
LeafCollectorLeafCollector.collect(int). Implementations
that need the score of the current document (passed-in to
LeafCollector.collect(int)), should save the passed-in Scorer and call
scorer.score() when needed.setScorer in interface LeafCollectorsetScorer in class SimpleCollectorjava.io.IOExceptionstatic TermsWithScoreCollector<?> create(java.lang.String field, boolean multipleValuesPerDocument, ScoreMode scoreMode)
TermsWithScoreCollector implementation.field - The field to collect terms formultipleValuesPerDocument - Whether the field to collect terms for has multiple values per document.TermsWithScoreCollector instancepublic boolean needsScores()
CollectorneedsScores in interface Collectortrue if scores are needed.