## org.apache.lucene.facet.associations
Class MultiAssociationsFacetsAggregator

    java.lang.Object
      org.apache.lucene.facet.associations.MultiAssociationsFacetsAggregator

All Implemented Interfaces:
  FacetsAggregator

    public class MultiAssociationsFacetsAggregator

extends Object
implements FacetsAggregator

A `FacetsAggregator` which chains multiple aggregators for aggregating the association values of categories that belong to the same category list. While nothing prevents you from chaining general purpose aggregators, it is only useful for aggregating association values, as each association type is written in its own list.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Constructor Summary
`MultiAssociationsFacetsAggregator(Map<CategoryPath,FacetsAggregator> aggregators)` Creates a new `MultiAssociationsFacetsAggregator` over the given aggregators.

Method Summary
`void` `aggregate(FacetsCollector.MatchingDocs matchingDocs, CategoryListParams clp, FacetArrays facetArrays)` Aggregate the facets found in the given matching documents.
`boolean` `requiresDocScores()` Returns `true` if this aggregator requires document scores.
`void` `rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays)` Rollup the values of the given ordinal.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MultiAssociationsFacetsAggregator

    public MultiAssociationsFacetsAggregator(Map<CategoryPath,FacetsAggregator> aggregators)

  Creates a new `MultiAssociationsFacetsAggregator` over the given aggregators. The mapping is used by `rollupValues(FacetRequest, int, int[], int[], FacetArrays)` to rollup the values of the specific category by the corresponding `FacetsAggregator`. However, since each `FacetsAggregator` handles the associations of a specific type, which could cover multiple categories, the aggregation is done on the unique set of aggregators, which are identified by their class.

Method Detail

### aggregate

    public void aggregate(FacetsCollector.MatchingDocs matchingDocs,
                          CategoryListParams clp,
                          FacetArrays facetArrays)
                   throws IOException

  Description copied from interface: `FacetsAggregator`
  Aggregate the facets found in the given matching documents.

  Specified by:
    `aggregate` in interface `FacetsAggregator`
  Throws:
    `IOException`

### rollupValues

    public void rollupValues(FacetRequest fr,
                             int ordinal,
                             int[] children,
                             int[] siblings,
                             FacetArrays facetArrays)

  Description copied from interface: `FacetsAggregator`
  Rollup the values of the given ordinal. This method is called when a category was indexed with `CategoryListParams.OrdinalPolicy.NO_PARENTS`. The given ordinal is the requested category, and you should use the children and siblings arrays to traverse its sub-tree.

  Specified by:
    `rollupValues` in interface `FacetsAggregator`

### requiresDocScores

    public boolean requiresDocScores()

  Description copied from interface: `FacetsAggregator`
  Returns `true` if this aggregator requires document scores.

  Specified by:
    `requiresDocScores` in interface `FacetsAggregator`

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