|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.Collector org.apache.lucene.facet.search.ScoredDocIdCollector
public abstract class ScoredDocIdCollector
A Collector
which stores all docIDs and their scores in a
ScoredDocIDs
instance. If scoring is not enabled, then the default
score as set in setDefaultScore(float)
(or
ScoredDocIDsIterator.DEFAULT_SCORE
) will be set for all documents.
Field Summary | |
---|---|
protected int |
docBase
|
protected OpenBitSet |
docIds
|
protected int |
numDocIds
|
Method Summary | |
---|---|
static ScoredDocIdCollector |
create(int maxDoc,
boolean enableScoring)
Creates a new ScoredDocIdCollector with the given parameters. |
abstract float |
getDefaultScore()
Returns the default score used when scoring is disabled. |
ScoredDocIDs |
getScoredDocIDs()
|
abstract ScoredDocIDsIterator |
scoredDocIdsIterator()
|
abstract void |
setDefaultScore(float defaultScore)
Set the default score. |
void |
setNextReader(IndexReader reader,
int base)
Called before collecting from each IndexReader. |
Methods inherited from class org.apache.lucene.search.Collector |
---|
acceptsDocsOutOfOrder, collect, setScorer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int numDocIds
protected int docBase
protected final OpenBitSet docIds
Method Detail |
---|
public static ScoredDocIdCollector create(int maxDoc, boolean enableScoring)
ScoredDocIdCollector
with the given parameters.
maxDoc
- the number of documents that are expected to be collected.
Note that if more documents are collected, unexpected exceptions may
be thrown. Usually you should pass IndexReader.maxDoc()
of
the same IndexReader with which the search is executed.enableScoring
- if scoring is enabled, a score will be computed for
every matching document, which might be expensive. Therefore if you
do not require scoring, it is better to set it to false.public abstract float getDefaultScore()
public abstract void setDefaultScore(float defaultScore)
public abstract ScoredDocIDsIterator scoredDocIdsIterator() throws IOException
IOException
public ScoredDocIDs getScoredDocIDs()
public void setNextReader(IndexReader reader, int base) throws IOException
Collector
Collector.collect(int)
will correspond to reader.
Add docBase to the current IndexReaders internal document id to re-base ids
in Collector.collect(int)
.
setNextReader
in class Collector
reader
- next IndexReader
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |