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 |
doSetNextReader(AtomicReaderContext context)
Performs the actual work of
setNextReader(AtomicReaderContext) . |
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.
|
void |
setNextReader(AtomicReaderContext context) |
acceptsDocsOutOfOrder, collect, 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.protected abstract void doSetNextReader(AtomicReaderContext context) throws IOException
setNextReader(AtomicReaderContext)
.IOException
public final List<FacetResult> getFacetResults() throws IOException
FacetResult
per FacetRequest
set in
FacetSearchParams
. Note that if a FacetRequest
defines a
CategoryPath
which does not exist in the taxonomy, an empty
FacetResult
will be returned for it.IOException
public final List<FacetsCollector.MatchingDocs> getMatchingDocs()
FacetsCollector.MatchingDocs
per
visited segment.public final void reset()
public final void setNextReader(AtomicReaderContext context) throws IOException
setNextReader
in class Collector
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.