Class TermGroupFacetCollector
- java.lang.Object
-
- org.apache.lucene.search.SimpleCollector
-
- org.apache.lucene.search.grouping.GroupFacetCollector
-
- org.apache.lucene.search.grouping.TermGroupFacetCollector
-
- All Implemented Interfaces:
Collector
,LeafCollector
- Direct Known Subclasses:
TermGroupFacetCollector.MV
,TermGroupFacetCollector.SV
public abstract class TermGroupFacetCollector extends GroupFacetCollector
An implementation ofGroupFacetCollector
that computes grouped facets based on the indexed terms from DocValues.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TermGroupFacetCollector.GroupedFacetHit
(package private) static class
TermGroupFacetCollector.MV
(package private) static class
TermGroupFacetCollector.SV
-
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.GroupFacetCollector
GroupFacetCollector.FacetEntry, GroupFacetCollector.GroupedFacetResult, GroupFacetCollector.SegmentResult
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<TermGroupFacetCollector.GroupedFacetHit>
groupedFacetHits
(package private) SortedDocValues
groupFieldTermsIndex
(package private) SentinelIntSet
segmentGroupedFacetHits
-
Fields inherited from class org.apache.lucene.search.grouping.GroupFacetCollector
endFacetOrd, facetField, facetPrefix, groupField, segmentFacetCounts, segmentResults, segmentTotalCount, startFacetOrd
-
-
Constructor Summary
Constructors Constructor Description TermGroupFacetCollector(java.lang.String groupField, java.lang.String facetField, BytesRef facetPrefix, int initialSize)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TermGroupFacetCollector
createTermGroupFacetCollector(java.lang.String groupField, java.lang.String facetField, boolean facetFieldMultivalued, BytesRef facetPrefix, int initialSize)
Factory method for creating the right implementation based on the fact whether the facet field contains multiple tokens per documents.-
Methods inherited from class org.apache.lucene.search.grouping.GroupFacetCollector
createSegmentResult, mergeSegmentResults, scoreMode, setScorer
-
Methods inherited from class org.apache.lucene.search.SimpleCollector
collect, doSetNextReader, getLeafCollector
-
-
-
-
Field Detail
-
groupedFacetHits
final java.util.List<TermGroupFacetCollector.GroupedFacetHit> groupedFacetHits
-
segmentGroupedFacetHits
final SentinelIntSet segmentGroupedFacetHits
-
groupFieldTermsIndex
SortedDocValues groupFieldTermsIndex
-
-
Constructor Detail
-
TermGroupFacetCollector
TermGroupFacetCollector(java.lang.String groupField, java.lang.String facetField, BytesRef facetPrefix, int initialSize)
-
-
Method Detail
-
createTermGroupFacetCollector
public static TermGroupFacetCollector createTermGroupFacetCollector(java.lang.String groupField, java.lang.String facetField, boolean facetFieldMultivalued, BytesRef facetPrefix, int initialSize)
Factory method for creating the right implementation based on the fact whether the facet field contains multiple tokens per documents.- Parameters:
groupField
- The group fieldfacetField
- The facet fieldfacetFieldMultivalued
- Whether the facet field has multiple tokens per documentfacetPrefix
- The facet prefix a facet entry should start with to be included.initialSize
- The initial allocation size of the internal int set and group facet list which should roughly match the total number of expected unique groups. Be aware that the heap usage is 4 bytes * initialSize.- Returns:
TermGroupFacetCollector
implementation
-
-