org.apache.lucene.facet.search
public class TaxonomyFacetsAccumulator extends FacetsAccumulator
FacetsAccumulator
suitable for accumulating categories that were
indexed into a taxonomy index.Modifier and Type | Field and Description |
---|---|
FacetArrays |
facetArrays |
IndexReader |
indexReader |
TaxonomyReader |
taxonomyReader |
searchParams
Constructor and Description |
---|
TaxonomyFacetsAccumulator(FacetSearchParams searchParams,
IndexReader indexReader,
TaxonomyReader taxonomyReader)
Initializes the accumulator with the given search params, index reader and
taxonomy reader.
|
TaxonomyFacetsAccumulator(FacetSearchParams searchParams,
IndexReader indexReader,
TaxonomyReader taxonomyReader,
FacetArrays facetArrays)
Initializes the accumulator with the given parameters as well as
FacetArrays . |
Modifier and Type | Method and Description |
---|---|
List<FacetResult> |
accumulate(List<FacetsCollector.MatchingDocs> matchingDocs)
Used by
FacetsCollector to build the list of facet results that match the facet requests that were
given in the constructor. |
protected FacetResultsHandler |
createFacetResultsHandler(FacetRequest fr,
OrdinalValueResolver resolver)
|
FacetsAggregator |
getAggregator()
Returns the
FacetsAggregator to use for aggregating the categories
found in the result documents. |
protected Map<CategoryListParams,List<FacetRequest>> |
groupRequests()
Group all requests that belong to the same
CategoryListParams . |
boolean |
requiresDocScores()
Used by
FacetsCollector to determine if document scores need to be
collected in addition to matching documents. |
create, create, emptyResult
public final TaxonomyReader taxonomyReader
public final IndexReader indexReader
public final FacetArrays facetArrays
public TaxonomyFacetsAccumulator(FacetSearchParams searchParams, IndexReader indexReader, TaxonomyReader taxonomyReader)
FacetArrays
,
which do not support reuse. If you want to use ReusingFacetArrays
,
you should use the
TaxonomyFacetsAccumulator(FacetSearchParams, IndexReader, TaxonomyReader)
constructor.public TaxonomyFacetsAccumulator(FacetSearchParams searchParams, IndexReader indexReader, TaxonomyReader taxonomyReader, FacetArrays facetArrays)
FacetArrays
. Note that the accumulator doesn't call
FacetArrays.free()
. If you require that (only makes sense if you
use ReusingFacetArrays
, you should do it after you've finished with
the accumulator.protected Map<CategoryListParams,List<FacetRequest>> groupRequests()
CategoryListParams
.public FacetsAggregator getAggregator()
FacetsAggregator
to use for aggregating the categories
found in the result documents.protected FacetResultsHandler createFacetResultsHandler(FacetRequest fr, OrdinalValueResolver resolver)
public List<FacetResult> accumulate(List<FacetsCollector.MatchingDocs> matchingDocs) throws IOException
FacetsCollector
to build the list of facet results
that match the facet requests
that were
given in the constructor.accumulate
in class FacetsAccumulator
matchingDocs
- the documents that matched the query, per-segment.IOException
public boolean requiresDocScores()
FacetsAccumulator
FacetsCollector
to determine if document scores need to be
collected in addition to matching documents.requiresDocScores
in class FacetsAccumulator
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.