public abstract class AbstractGroupFacetCollector extends Collector
Modifier and Type | Class and Description |
---|---|
static class |
AbstractGroupFacetCollector.FacetEntry
Represents a facet entry with a value and a count.
|
static class |
AbstractGroupFacetCollector.GroupedFacetResult
The grouped facet result.
|
protected static class |
AbstractGroupFacetCollector.SegmentResult
Contains the local grouped segment counts for a particular segment.
|
Modifier and Type | Field and Description |
---|---|
protected int |
endFacetOrd |
protected String |
facetField |
protected BytesRef |
facetPrefix |
protected String |
groupField |
protected int[] |
segmentFacetCounts |
protected List<AbstractGroupFacetCollector.SegmentResult> |
segmentResults |
protected int |
segmentTotalCount |
protected int |
startFacetOrd |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGroupFacetCollector(String groupField,
String facetField,
BytesRef facetPrefix) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsDocsOutOfOrder()
Return
true if this collector does not
require the matching docIDs to be delivered in int sort
order (smallest to largest) to Collector.collect(int) . |
protected abstract AbstractGroupFacetCollector.SegmentResult |
createSegmentResult() |
AbstractGroupFacetCollector.GroupedFacetResult |
mergeSegmentResults(int size,
int minCount,
boolean orderByCount)
Returns grouped facet results that were computed over zero or more segments.
|
void |
setScorer(Scorer scorer)
Called before successive calls to
Collector.collect(int) . |
collect, setNextReader
protected final String groupField
protected final String facetField
protected final BytesRef facetPrefix
protected final List<AbstractGroupFacetCollector.SegmentResult> segmentResults
protected int[] segmentFacetCounts
protected int segmentTotalCount
protected int startFacetOrd
protected int endFacetOrd
public AbstractGroupFacetCollector.GroupedFacetResult mergeSegmentResults(int size, int minCount, boolean orderByCount) throws IOException
size
- The total number of facets to include. This is typically offset + limitminCount
- The minimum count a facet entry should have to be included in the grouped facet resultorderByCount
- Whether to sort the facet entries by facet entry count. If false
then the facets
are sorted lexicographically in ascending order.IOException
- If I/O related errors occur during merging segment grouped facet counts.protected abstract AbstractGroupFacetCollector.SegmentResult createSegmentResult() throws IOException
IOException
public void setScorer(Scorer scorer) throws IOException
Collector
Collector.collect(int)
. Implementations
that need the score of the current document (passed-in to
Collector.collect(int)
), should save the passed-in Scorer and call
scorer.score() when needed.setScorer
in class Collector
IOException
public boolean acceptsDocsOutOfOrder()
Collector
true
if this collector does not
require the matching docIDs to be delivered in int sort
order (smallest to largest) to Collector.collect(int)
.
Most Lucene Query implementations will visit
matching docIDs in order. However, some queries
(currently limited to certain cases of BooleanQuery
) can achieve faster searching if the
Collector
allows them to deliver the
docIDs out of order.
Many collectors don't mind getting docIDs out of
order, so it's important to return true
here.
acceptsDocsOutOfOrder
in class Collector
Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.