org.apache.lucene.search.grouping.term

## Class TermGroupFacetCollector

- java.lang.Object
- - org.apache.lucene.search.Collector
  - - org.apache.lucene.search.grouping.AbstractGroupFacetCollector
    - - org.apache.lucene.search.grouping.term.TermGroupFacetCollector

-     public abstract class TermGroupFacetCollector
      extends AbstractGroupFacetCollector

  An implementation of `AbstractGroupFacetCollector` that computes grouped facets based on the indexed terms from the `FieldCache`.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.AbstractGroupFacetCollector

      `AbstractGroupFacetCollector.FacetEntry, AbstractGroupFacetCollector.GroupedFacetResult, AbstractGroupFacetCollector.SegmentResult`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.search.grouping.AbstractGroupFacetCollector

      `endFacetOrd, facetField, facetPrefix, groupField, segmentFacetCounts, segmentResults, segmentTotalCount, startFacetOrd`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.

    - ### Methods inherited from class org.apache.lucene.search.grouping.AbstractGroupFacetCollector

      `acceptsDocsOutOfOrder, createSegmentResult, mergeSegmentResults, setScorer`

    - ### Methods inherited from class org.apache.lucene.search.Collector

      `collect, setNextReader`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### 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 field
        `facetField` - The facet field
        `facetFieldMultivalued` - Whether the facet field has multiple tokens per document
        `facetPrefix` - 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

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.