public class FacetsAccumulator extends Object
Modifier and Type | Field and Description |
---|---|
FacetArrays |
facetArrays |
IndexReader |
indexReader |
FacetSearchParams |
searchParams |
TaxonomyReader |
taxonomyReader |
Constructor and Description |
---|
FacetsAccumulator(FacetSearchParams searchParams,
IndexReader indexReader,
TaxonomyReader taxonomyReader)
Initializes the accumulator with the given search params, index reader and
taxonomy reader.
|
FacetsAccumulator(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. |
static FacetsAccumulator |
create(FacetSearchParams fsp,
IndexReader indexReader,
TaxonomyReader taxoReader)
Creates an appropriate
FacetsAccumulator ,
returning FacetsAccumulator when all requests
are CountFacetRequest and only one partition is
in use, otherwise StandardFacetsAccumulator . |
protected FacetResultsHandler |
createFacetResultsHandler(FacetRequest fr)
Creates a
FacetResultsHandler that matches the given
FacetRequest . |
protected static FacetResult |
emptyResult(int ordinal,
FacetRequest fr)
Returns an empty
FacetResult . |
FacetsAggregator |
getAggregator()
Returns the
FacetsAggregator to use for aggregating the categories
found in the result documents. |
protected Set<CategoryListParams> |
getCategoryLists() |
public final TaxonomyReader taxonomyReader
public final IndexReader indexReader
public final FacetArrays facetArrays
public FacetSearchParams searchParams
public FacetsAccumulator(FacetSearchParams searchParams, IndexReader indexReader, TaxonomyReader taxonomyReader)
FacetArrays
,
which do not support reuse. If you want to use ReusingFacetArrays
,
you should use the
FacetsAccumulator(FacetSearchParams, IndexReader, TaxonomyReader, FacetArrays)
constructor.public FacetsAccumulator(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.public static FacetsAccumulator create(FacetSearchParams fsp, IndexReader indexReader, TaxonomyReader taxoReader)
FacetsAccumulator
,
returning FacetsAccumulator
when all requests
are CountFacetRequest
and only one partition is
in use, otherwise StandardFacetsAccumulator
.protected static FacetResult emptyResult(int ordinal, FacetRequest fr)
FacetResult
.public FacetsAggregator getAggregator()
FacetsAggregator
to use for aggregating the categories
found in the result documents. The default implementation returns
CountingFacetsAggregator
, or FastCountingFacetsAggregator
if all categories can be decoded with DGapVInt8IntDecoder
.protected FacetResultsHandler createFacetResultsHandler(FacetRequest fr)
FacetResultsHandler
that matches the given
FacetRequest
.protected Set<CategoryListParams> getCategoryLists()
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.matchingDocs
- the documents that matched the query, per-segment.IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.