public abstract class FacetsCollector extends Collector
Collector
which executes faceted search and computes the weight of
requested facets. To get the facet results you should call
getFacetResults()
.
create(FacetSearchParams, IndexReader, TaxonomyReader)
returns the
most optimized FacetsCollector
for the given parameters.Modifier and Type | Class and Description |
---|---|
static class |
FacetsCollector.MatchingDocs
Holds the documents that were matched in the
AtomicReaderContext . |
Modifier and Type | Field and Description |
---|---|
protected List<FacetsCollector.MatchingDocs> |
matchingDocs |
Modifier | Constructor and Description |
---|---|
protected |
FacetsCollector(FacetsAccumulator accumulator) |
Modifier and Type | Method and Description |
---|---|
static FacetsCollector |
create(FacetsAccumulator accumulator)
Creates a
FacetsCollector that satisfies the requirements of the
given FacetsAccumulator . |
static FacetsCollector |
create(FacetSearchParams fsp,
IndexReader indexReader,
TaxonomyReader taxoReader)
|
protected abstract void |
finish()
Called when the Collector has finished, so that the last
FacetsCollector.MatchingDocs can be added. |
List<FacetResult> |
getFacetResults()
|
List<FacetsCollector.MatchingDocs> |
getMatchingDocs()
Returns the documents matched by the query, one
FacetsCollector.MatchingDocs per
visited segment. |
void |
reset()
Allows to reuse the collector between search requests.
|
acceptsDocsOutOfOrder, collect, setNextReader, setScorer
protected final List<FacetsCollector.MatchingDocs> matchingDocs
protected FacetsCollector(FacetsAccumulator accumulator)
public static FacetsCollector create(FacetSearchParams fsp, IndexReader indexReader, TaxonomyReader taxoReader)
public static FacetsCollector create(FacetsAccumulator accumulator)
FacetsCollector
that satisfies the requirements of the
given FacetsAccumulator
.protected abstract void finish()
FacetsCollector.MatchingDocs
can be added.public final List<FacetResult> getFacetResults() throws IOException
FacetResult
per FacetRequest
set in
FacetSearchParams
. Note that if one of the requests
is for a CategoryPath
that does not exist in the taxonomy,
no matching FacetResult
will be returned.IOException
public final List<FacetsCollector.MatchingDocs> getMatchingDocs()
FacetsCollector.MatchingDocs
per
visited segment.public final void reset()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.