org.apache.lucene.facet.search
public class MultiFacetsAggregator extends Object implements FacetsAggregator
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.| Constructor and Description |
|---|
MultiFacetsAggregator(Map<CategoryPath,FacetsAggregator> aggregators)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(FacetsCollector.MatchingDocs matchingDocs,
CategoryListParams clp,
FacetArrays facetArrays)
Aggregate the facets found in the given matching documents.
|
OrdinalValueResolver |
createOrdinalValueResolver(FacetRequest facetRequest,
FacetArrays arrays)
Creates the appropriate
OrdinalValueResolver for this aggregator
and the given FacetRequest. |
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.
|
public MultiFacetsAggregator(Map<CategoryPath,FacetsAggregator> aggregators)
The mapping is used to rollup the values of the specific category by the
corresponding FacetsAggregator. It is ok to pass differnet
FacetsAggregator instances for each CategoryPath - the
constructor ensures that each aggregator type (determined by its
class) is invoked only once.
public void aggregate(FacetsCollector.MatchingDocs matchingDocs, CategoryListParams clp, FacetArrays facetArrays) throws IOException
FacetsAggregatoraggregate in interface FacetsAggregatorIOExceptionpublic void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays)
FacetsAggregatorCategoryListParams.OrdinalPolicy.NO_PARENTS. The given
ordinal is the requested category, and you should use the children and
siblings arrays to traverse its sub-tree.rollupValues in interface FacetsAggregatorpublic boolean requiresDocScores()
FacetsAggregatortrue if this aggregator requires document scores.requiresDocScores in interface FacetsAggregatorpublic OrdinalValueResolver createOrdinalValueResolver(FacetRequest facetRequest, FacetArrays arrays)
FacetsAggregatorOrdinalValueResolver for this aggregator
and the given FacetRequest. The request is passed so that compound
aggregators can return the correct OrdinalValueResolver.createOrdinalValueResolver in interface FacetsAggregatorCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.