Module org.apache.lucene.grouping
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
An implementation of
GroupFacetCollector
that computes grouped facets based on the
indexed terms from DocValues.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final record
(package private) static class
(package private) static class
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.GroupFacetCollector
GroupFacetCollector.FacetEntry, GroupFacetCollector.GroupedFacetResult, GroupFacetCollector.SegmentResult
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final List
<TermGroupFacetCollector.GroupedFacetHit> (package private) SortedDocValues
(package private) final SentinelIntSet
Fields inherited from class org.apache.lucene.search.grouping.GroupFacetCollector
endFacetOrd, facetField, facetPrefix, groupField, segmentFacetCounts, segmentResults, segmentTotalCount, startFacetOrd
-
Constructor Summary
ConstructorsConstructorDescriptionTermGroupFacetCollector
(String groupField, String facetField, BytesRef facetPrefix, int initialSize) -
Method Summary
Modifier and TypeMethodDescriptionstatic TermGroupFacetCollector
createTermGroupFacetCollector
(String groupField, 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, finish, mergeSegmentResults, scoreMode, setScorer
Methods inherited from class org.apache.lucene.search.SimpleCollector
collect, doSetNextReader, getLeafCollector
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.LeafCollector
collect, competitiveIterator
-
Field Details
-
groupedFacetHits
-
segmentGroupedFacetHits
-
groupFieldTermsIndex
SortedDocValues groupFieldTermsIndex
-
-
Constructor Details
-
TermGroupFacetCollector
-
-
Method Details
-
createTermGroupFacetCollector
public static TermGroupFacetCollector createTermGroupFacetCollector(String groupField, 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
-