org.apache.lucene.facet.search
public abstract class FacetsAccumulator extends Object
FacetSearchParams
.Modifier and Type | Field and Description |
---|---|
FacetSearchParams |
searchParams |
Modifier | Constructor and Description |
---|---|
protected |
FacetsAccumulator(FacetSearchParams fsp)
Constructor with the given search params.
|
Modifier and Type | Method and Description |
---|---|
abstract 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,
FacetArrays arrays)
Creates a
FacetsAccumulator for the given facet requests. |
static FacetsAccumulator |
create(FacetSearchParams fsp,
SortedSetDocValuesReaderState state,
FacetArrays arrays)
Creates a
FacetsAccumulator for the given facet requests. |
protected static FacetResult |
emptyResult(int ordinal,
FacetRequest fr)
Returns an empty
FacetResult . |
abstract boolean |
requiresDocScores()
Used by
FacetsCollector to determine if document scores need to be
collected in addition to matching documents. |
public FacetSearchParams searchParams
protected FacetsAccumulator(FacetSearchParams fsp)
public static FacetsAccumulator create(FacetSearchParams fsp, IndexReader indexReader, TaxonomyReader taxoReader, FacetArrays arrays)
FacetsAccumulator
for the given facet requests. This
method supports RangeAccumulator
and
TaxonomyFacetsAccumulator
by dividing the facet requests into
RangeFacetRequest
and the rest.
If both types of facet requests are used, it returns a
MultiFacetsAccumulator
and the facet results returned from
accumulate(List)
may not be in the same order as the given facet
requests.
fsp
- the search params define the facet requests and the
FacetIndexingParams
indexReader
- the IndexReader
used for searchtaxoReader
- the TaxonomyReader
used for searcharrays
- the FacetArrays
which the accumulator should use to store
the categories weights in. Can be null
.public static FacetsAccumulator create(FacetSearchParams fsp, SortedSetDocValuesReaderState state, FacetArrays arrays) throws IOException
FacetsAccumulator
for the given facet requests. This
method supports RangeAccumulator
and
SortedSetDocValuesAccumulator
by dividing the facet requests into
RangeFacetRequest
and the rest.
If both types of facet requests are used, it returns a
MultiFacetsAccumulator
and the facet results returned from
accumulate(List)
may not be in the same order as the given facet
requests.
fsp
- the search params define the facet requests and the
FacetIndexingParams
state
- the SortedSetDocValuesReaderState
needed for accumulating
the categoriesarrays
- the FacetArrays
which the accumulator should use to
store the categories weights in. Can be null
.IOException
protected static FacetResult emptyResult(int ordinal, FacetRequest fr)
FacetResult
.public abstract 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
public abstract boolean requiresDocScores()
FacetsCollector
to determine if document scores need to be
collected in addition to matching documents.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.