public abstract class GroupFacetCollector extends SimpleCollector
Modifier and Type | Class and Description |
---|---|
static class |
GroupFacetCollector.FacetEntry
Represents a facet entry with a value and a count.
|
static class |
GroupFacetCollector.GroupedFacetResult
The grouped facet result.
|
protected static class |
GroupFacetCollector.SegmentResult
Contains the local grouped segment counts for a particular segment.
|
private static class |
GroupFacetCollector.SegmentResultPriorityQueue |
Modifier and Type | Field and Description |
---|---|
protected int |
endFacetOrd |
protected java.lang.String |
facetField |
protected BytesRef |
facetPrefix |
protected java.lang.String |
groupField |
protected int[] |
segmentFacetCounts |
protected java.util.List<GroupFacetCollector.SegmentResult> |
segmentResults |
protected int |
segmentTotalCount |
protected int |
startFacetOrd |
Modifier | Constructor and Description |
---|---|
protected |
GroupFacetCollector(java.lang.String groupField,
java.lang.String facetField,
BytesRef facetPrefix) |
Modifier and Type | Method and Description |
---|---|
protected abstract GroupFacetCollector.SegmentResult |
createSegmentResult() |
GroupFacetCollector.GroupedFacetResult |
mergeSegmentResults(int size,
int minCount,
boolean orderByCount)
Returns grouped facet results that were computed over zero or more segments.
|
ScoreMode |
scoreMode()
Indicates what features are required from the scorer.
|
void |
setScorer(Scorable scorer)
Called before successive calls to
LeafCollector.collect(int) . |
collect, doSetNextReader, getLeafCollector
protected final java.lang.String groupField
protected final java.lang.String facetField
protected final BytesRef facetPrefix
protected final java.util.List<GroupFacetCollector.SegmentResult> segmentResults
protected int[] segmentFacetCounts
protected int segmentTotalCount
protected int startFacetOrd
protected int endFacetOrd
protected GroupFacetCollector(java.lang.String groupField, java.lang.String facetField, BytesRef facetPrefix)
public GroupFacetCollector.GroupedFacetResult mergeSegmentResults(int size, int minCount, boolean orderByCount) throws java.io.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.java.io.IOException
- If I/O related errors occur during merging segment grouped facet counts.protected abstract GroupFacetCollector.SegmentResult createSegmentResult() throws java.io.IOException
java.io.IOException
public void setScorer(Scorable scorer) throws java.io.IOException
LeafCollector
LeafCollector.collect(int)
. Implementations
that need the score of the current document (passed-in to
LeafCollector.collect(int)
), should save the passed-in Scorer and call
scorer.score() when needed.setScorer
in interface LeafCollector
setScorer
in class SimpleCollector
java.io.IOException