Package org.apache.lucene.facet.search
Class ScoredDocIdCollector
- java.lang.Object
-
- org.apache.lucene.search.Collector
-
- org.apache.lucene.facet.search.ScoredDocIdCollector
-
public abstract class ScoredDocIdCollector extends Collector
ACollectorwhich stores all docIDs and their scores in aScoredDocIDsinstance. If scoring is not enabled, then the default score as set insetDefaultScore(float)(orScoredDocIDsIterator.DEFAULT_SCORE) will be set for all documents.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description protected intdocBaseprotected FixedBitSetdocIdsprotected intnumDocIds
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ScoredDocIdCollectorcreate(int maxDoc, boolean enableScoring)Creates a newScoredDocIdCollectorwith the given parameters.abstract floatgetDefaultScore()Returns the default score used when scoring is disabled.ScoredDocIDsgetScoredDocIDs()abstract ScoredDocIDsIteratorscoredDocIdsIterator()abstract voidsetDefaultScore(float defaultScore)Set the default score.voidsetNextReader(IndexReader reader, int base)Called before collecting from each IndexReader.-
Methods inherited from class org.apache.lucene.search.Collector
acceptsDocsOutOfOrder, collect, setScorer
-
-
-
-
Field Detail
-
numDocIds
protected int numDocIds
-
docBase
protected int docBase
-
docIds
protected final FixedBitSet docIds
-
-
Method Detail
-
create
public static ScoredDocIdCollector create(int maxDoc, boolean enableScoring)
Creates a newScoredDocIdCollectorwith the given parameters.- 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 passIndexReader.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.
-
getDefaultScore
public abstract float getDefaultScore()
Returns the default score used when scoring is disabled.
-
setDefaultScore
public abstract void setDefaultScore(float defaultScore)
Set the default score. Only applicable if scoring is disabled.
-
scoredDocIdsIterator
public abstract ScoredDocIDsIterator scoredDocIdsIterator() throws IOException
- Throws:
IOException
-
getScoredDocIDs
public ScoredDocIDs getScoredDocIDs()
-
setNextReader
public void setNextReader(IndexReader reader, int base) throws IOException
Description copied from class:CollectorCalled before collecting from each IndexReader. All doc ids inCollector.collect(int)will correspond to reader. Add docBase to the current IndexReaders internal document id to re-base ids inCollector.collect(int).- Specified by:
setNextReaderin classCollector- Parameters:
reader- next IndexReader- Throws:
IOException
-
-