Class GroupFacetCollector
java.lang.Object
org.apache.lucene.search.SimpleCollector
org.apache.lucene.search.grouping.GroupFacetCollector
- All Implemented Interfaces:
Collector,LeafCollector
- Direct Known Subclasses:
TermGroupFacetCollector
Base class for computing grouped facets.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a facet entry with a value and a count.static classThe grouped facet result.protected static classContains the local grouped segment counts for a particular segment. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final Stringprotected final BytesRefprotected final Stringprotected int[]protected final List<GroupFacetCollector.SegmentResult> protected intprotected int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGroupFacetCollector(String groupField, String facetField, BytesRef facetPrefix) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract GroupFacetCollector.SegmentResultvoidfinish()mergeSegmentResults(int size, int minCount, boolean orderByCount) Returns grouped facet results that were computed over zero or more segments.voidMethods inherited from class org.apache.lucene.search.SimpleCollector
collect, doSetNextReader, getLeafCollectorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.search.LeafCollector
collect, competitiveIterator
-
Field Details
-
groupField
-
facetField
-
facetPrefix
-
segmentResults
-
segmentFacetCounts
protected int[] segmentFacetCounts -
segmentTotalCount
protected int segmentTotalCount -
startFacetOrd
protected int startFacetOrd -
endFacetOrd
protected int endFacetOrd
-
-
Constructor Details
-
GroupFacetCollector
-
-
Method Details
-
mergeSegmentResults
public GroupFacetCollector.GroupedFacetResult mergeSegmentResults(int size, int minCount, boolean orderByCount) throws IOException Returns grouped facet results that were computed over zero or more segments. Grouped facet counts are merged from zero or more segment results.- Parameters:
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. Iffalsethen the facets are sorted lexicographically in ascending order.- Returns:
- grouped facet results
- Throws:
IOException- If I/O related errors occur during merging segment grouped facet counts.
-
finish
- Throws:
IOException
-
createSegmentResult
- Throws:
IOException
-
setScorer
- Specified by:
setScorerin interfaceLeafCollector- Overrides:
setScorerin classSimpleCollector- Throws:
IOException
-
scoreMode
-