public class TopSuggestDocsCollector
extends SimpleCollector
org.apache.lucene.search.Collector that collects completion and
score, along with document id
Non scoring collector that collect completions in order of their pre-computed scores.
NOTE: One document can be collected multiple times if a document is matched for multiple unique completions for a given query
Subclasses should only override
collect(int, CharSequence, CharSequence, float).
NOTE: #setScorer(org.apache.lucene.search.Scorable) and
collect(int) is not used
| Modifier and Type | Field and Description |
|---|---|
protected int |
docBase
Document base offset for the current Leaf
|
| Constructor and Description |
|---|
TopSuggestDocsCollector(int num,
boolean skipDuplicates)
Sole constructor
Collects at most
num completions
with corresponding document and weight |
| Modifier and Type | Method and Description |
|---|---|
void |
collect(int doc)
Ignored
|
void |
collect(int docID,
java.lang.CharSequence key,
java.lang.CharSequence context,
float score)
Called for every matched completion,
similar to
org.apache.lucene.search.LeafCollector#collect(int)
but for completions. |
protected void |
doSetNextReader(LeafReaderContext context) |
protected boolean |
doSkipDuplicates()
Returns true if duplicates are filtered out
|
TopSuggestDocs |
get()
Returns at most
num Top scoring TopSuggestDocss |
int |
getCountToCollect()
Returns the number of results to be collected
|
ScoreMode |
scoreMode()
Ignored
|
public TopSuggestDocsCollector(int num,
boolean skipDuplicates)
num completions
with corresponding document and weightprotected boolean doSkipDuplicates()
public int getCountToCollect()
protected void doSetNextReader(LeafReaderContext context)
throws java.io.IOException
java.io.IOExceptionpublic void collect(int docID,
java.lang.CharSequence key,
java.lang.CharSequence context,
float score)
throws java.io.IOException
org.apache.lucene.search.LeafCollector#collect(int)
but for completions.
NOTE: collection at the leaf level is guaranteed to be in
descending order of scorejava.io.IOExceptionpublic TopSuggestDocs get() throws java.io.IOException
num Top scoring TopSuggestDocssjava.io.IOExceptionpublic void collect(int doc)
throws java.io.IOException
java.io.IOExceptionpublic ScoreMode scoreMode()
Data In Motion GmbH all rights reserved