public class DocValuesCollector
extends org.apache.lucene.search.SimpleCollector
DocIdSets and LeafReaderContexts for every
segment that contains a hit. Those items can be later used to read DocValues fields
and iterate over the matched DocIdSets. This collector is different from
org.apache.lucene.search.CachingCollector in that the later focuses on predictable RAM usage
and feeding other collectors while this collector focuses on exposing the required per-segment data structures
to the user.| Modifier and Type | Class and Description |
|---|---|
static class |
DocValuesCollector.LongValuesIterator
Iterates over all per-segment
DocValuesCollector.MatchingDocs. |
| Constructor and Description |
|---|
DocValuesCollector()
Default Constructor, does not keep scores.
|
DocValuesCollector(boolean keepScores) |
| Modifier and Type | Method and Description |
|---|---|
void |
collect(int doc) |
void |
doSetNextReader(org.apache.lucene.index.LeafReaderContext context) |
org.neo4j.graphdb.index.IndexHits<org.apache.lucene.document.Document> |
getIndexHits(org.apache.lucene.search.Sort sort)
Replay the search and collect every hit into TopDocs.
|
List<org.neo4j.kernel.api.impl.index.collector.DocValuesCollector.MatchingDocs> |
getMatchingDocs() |
ValuesIterator |
getSortedValuesIterator(String field,
org.apache.lucene.search.Sort sort) |
int |
getTotalHits() |
DocValuesCollector.LongValuesIterator |
getValuesIterator(String field) |
boolean |
isKeepScores() |
boolean |
needsScores() |
void |
setScorer(org.apache.lucene.search.Scorer scorer) |
public DocValuesCollector()
public DocValuesCollector(boolean keepScores)
keepScores - true if you want to trade correctness for speedpublic DocValuesCollector.LongValuesIterator getValuesIterator(String field)
field - the field that contains the valuespublic ValuesIterator getSortedValuesIterator(String field, org.apache.lucene.search.Sort sort) throws IOException
field - the field that contains the valuessort - how the results should be sortedIOExceptionpublic org.neo4j.graphdb.index.IndexHits<org.apache.lucene.document.Document> getIndexHits(org.apache.lucene.search.Sort sort)
throws IOException
ScoreDoc is allocated
for every hit and the Document instance is loaded lazily with on every iteration step.sort - how to sort the iterator. If this is null, results will be in index-order.IOExceptionpublic int getTotalHits()
public boolean isKeepScores()
public final void collect(int doc)
throws IOException
collect in interface org.apache.lucene.search.LeafCollectorcollect in class org.apache.lucene.search.SimpleCollectorIOExceptionpublic boolean needsScores()
public void setScorer(org.apache.lucene.search.Scorer scorer)
throws IOException
setScorer in interface org.apache.lucene.search.LeafCollectorsetScorer in class org.apache.lucene.search.SimpleCollectorIOExceptionpublic void doSetNextReader(org.apache.lucene.index.LeafReaderContext context)
throws IOException
doSetNextReader in class org.apache.lucene.search.SimpleCollectorIOExceptionpublic List<org.neo4j.kernel.api.impl.index.collector.DocValuesCollector.MatchingDocs> getMatchingDocs()
MatchingDocs per visited segment that contains a hit.Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.