org.apache.solr.analytics.accumulator.facet

## Class FieldFacetAccumulator

- java.lang.Object
- - org.apache.lucene.search.SimpleCollector
  - - org.apache.solr.analytics.accumulator.ValueAccumulator
    - - org.apache.solr.analytics.accumulator.facet.FieldFacetAccumulator

- All Implemented Interfaces:
    Collector, LeafCollector

      public class FieldFacetAccumulator
      extends ValueAccumulator

  An Accumulator that manages the faceting for fieldFacets. Collects the field facet values.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `dateField`
    `protected boolean` | `multiValued`
    `protected String` | `name`
    `protected boolean` | `numField`
    `protected NumericDocValues` | `numValues`
    `protected Bits` | `numValuesBits`
    `protected FacetValueAccumulator` | `parent`
    `protected AnalyticsParsers.Parser` | `parser`
    `protected SchemaField` | `schemaField`
    `protected SolrIndexSearcher` | `searcher`
    `protected SortedSetDocValues` | `setValues`
    `protected SortedDocValues` | `sortValues`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FieldFacetAccumulator(SolrIndexSearcher searcher, FacetValueAccumulator parent, SchemaField schemaField)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collect(int doc)` Tell the FacetingAccumulator to collect the doc with the given fieldFacet and value(s).
    `void` | `compute()` Finalizes the statistics within each StatsCollector.
    `static FieldFacetAccumulator` | `create(SolrIndexSearcher searcher, FacetValueAccumulator parent, SchemaField facetField)`
    `protected void` | `doSetNextReader(LeafReaderContext context)` Move to the next set of documents to add to the field facet.
    `NamedList<?>` | `export()`
    `boolean` | `needsScores()`

    - ### Methods inherited from class org.apache.solr.analytics.accumulator.ValueAccumulator

      `postProcess`

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

      `getLeafCollector, setScorer`

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

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

- - ### Field Detail

    - #### parser

          protected final AnalyticsParsers.Parser parser

    - #### parent

          protected final FacetValueAccumulator parent

    - #### name

          protected final String name

    - #### searcher

          protected final SolrIndexSearcher searcher

    - #### schemaField

          protected final SchemaField schemaField

    - #### multiValued

          protected final boolean multiValued

    - #### numField

          protected final boolean numField

    - #### dateField

          protected final boolean dateField

    - #### setValues

          protected SortedSetDocValues setValues

    - #### sortValues

          protected SortedDocValues sortValues

    - #### numValues

          protected NumericDocValues numValues

    - #### numValuesBits

          protected Bits numValuesBits

  - ### Constructor Detail

    - #### FieldFacetAccumulator

          public FieldFacetAccumulator(SolrIndexSearcher searcher,
                                       FacetValueAccumulator parent,
                                       SchemaField schemaField)
                                throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### create

          public static FieldFacetAccumulator create(SolrIndexSearcher searcher,
                                                     FacetValueAccumulator parent,
                                                     SchemaField facetField)
                                              throws IOException

      Throws:
        `IOException`

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext context)
                                  throws IOException

      Move to the next set of documents to add to the field facet.
      Overrides:
        `doSetNextReader` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### collect

          public void collect(int doc)
                       throws IOException

      Tell the FacetingAccumulator to collect the doc with the given fieldFacet and value(s).
      Specified by:
        `collect` in interface `LeafCollector`
      Specified by:
        `collect` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### compute

          public void compute()

      Description copied from class: `ValueAccumulator`
      Finalizes the statistics within each StatsCollector. Must be called before `export()`.
      Specified by:
        `compute` in class `ValueAccumulator`

    - #### export

          public NamedList<?> export()

      Specified by:
        `export` in class `ValueAccumulator`

    - #### needsScores

          public boolean needsScores()

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