public final class FirstHitCollector
extends org.apache.lucene.search.SimpleCollector
Collector that terminates the collection after the very first hit.
As a consequence, additional collectors in this search that require a complete run over the index,
such as TotalHitCountCollector or DocValuesCollector, won't work as expected.| Modifier and Type | Field and Description |
|---|---|
static int |
NO_MATCH |
| Constructor and Description |
|---|
FirstHitCollector() |
| Modifier and Type | Method and Description |
|---|---|
void |
collect(int doc) |
int |
getMatchedDoc() |
boolean |
hasMatched() |
boolean |
needsScores() |
public static final int NO_MATCH
public boolean hasMatched()
public int getMatchedDoc()
NO_MATCH.public void collect(int doc)
throws IOException
collect in interface org.apache.lucene.search.LeafCollectorcollect in class org.apache.lucene.search.SimpleCollectorIOExceptionpublic boolean needsScores()
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.