org.apache.solr.analytics.accumulator.facet

## Class QueryFacetAccumulator

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

- All Implemented Interfaces:
    Collector, LeafCollector
  Direct Known Subclasses:
    RangeFacetAccumulator

      public class QueryFacetAccumulator
      extends ValueAccumulator

  An Accumulator that manages a certain query of a given query facet.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `facetName`
    `protected String` | `facetValue`
    `protected FacetValueAccumulator` | `parent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryFacetAccumulator(FacetValueAccumulator parent, String facetName, String facetValue)`

  - ### Method Summary

    All 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 queryFacet and query.
    `void` | `compute()` Finalizes the statistics within each StatsCollector.
    `protected void` | `doSetNextReader(LeafReaderContext context)` Update the readers of the queryFacet `StatsCollector`s in FacetingAccumulator
    `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

    - #### parent

          protected final FacetValueAccumulator parent

    - #### facetName

          protected final String facetName

    - #### facetValue

          protected final String facetValue

  - ### Constructor Detail

    - #### QueryFacetAccumulator

          public QueryFacetAccumulator(FacetValueAccumulator parent,
                                       String facetName,
                                       String facetValue)

  - ### Method Detail

    - #### collect

          public void collect(int doc)
                       throws IOException

      Tell the FacetingAccumulator to collect the doc with the given queryFacet and query.
      Specified by:
        `collect` in interface `LeafCollector`
      Specified by:
        `collect` in class `SimpleCollector`
      Throws:
        `IOException`

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext context)
                                  throws IOException

      Update the readers of the queryFacet `StatsCollector`s in FacetingAccumulator
      Overrides:
        `doSetNextReader` 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.