org.apache.lucene.facet.sampling
Class SamplingAccumulator
java.lang.Object
org.apache.lucene.facet.search.FacetsAccumulator
org.apache.lucene.facet.search.TaxonomyFacetsAccumulator
org.apache.lucene.facet.old.OldFacetsAccumulator
org.apache.lucene.facet.sampling.SamplingAccumulator
public class SamplingAccumulator
- extends OldFacetsAccumulator
Facets accumulation with sampling.
Note two major differences between this class and SamplingWrapper
:
- Latter can wrap any other
FacetsAccumulator
while this class
directly extends OldFacetsAccumulator
.
- This class can effectively apply sampling on the complement set of
matching document, thereby working efficiently with the complement
optimization - see
OldFacetsAccumulator.getComplementThreshold()
.
Note: Sampling accumulation (Accumulation over a sampled-set of the results),
does not guarantee accurate values for
FacetResult.getNumValidDescendants()
.
- See Also:
Sampler
- WARNING: This API is experimental and might change in incompatible ways in the next release.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SamplingAccumulator
public SamplingAccumulator(Sampler sampler,
FacetSearchParams searchParams,
IndexReader indexReader,
TaxonomyReader taxonomyReader,
FacetArrays facetArrays)
SamplingAccumulator
public SamplingAccumulator(Sampler sampler,
FacetSearchParams searchParams,
IndexReader indexReader,
TaxonomyReader taxonomyReader)
- Constructor...
accumulate
public List<FacetResult> accumulate(ScoredDocIDs docids)
throws IOException
- Overrides:
accumulate
in class OldFacetsAccumulator
- Throws:
IOException
actualDocsToAccumulate
protected ScoredDocIDs actualDocsToAccumulate(ScoredDocIDs docids)
throws IOException
- Description copied from class:
OldFacetsAccumulator
- Set the actual set of documents over which accumulation should take place.
Allows to override the set of documents to accumulate for. Invoked just
before actual accumulating starts. From this point that set of documents
remains unmodified. Default implementation just returns the input
unchanged.
- Overrides:
actualDocsToAccumulate
in class OldFacetsAccumulator
- Parameters:
docids
- candidate documents to accumulate for
- Returns:
- actual documents to accumulate for
- Throws:
IOException
getTotalCountsFactor
protected double getTotalCountsFactor()
- Description copied from class:
OldFacetsAccumulator
- Expert: factor by which counts should be multiplied when initializing
the count arrays from total counts.
Default implementation for this returns 1, which is a no op.
- Overrides:
getTotalCountsFactor
in class OldFacetsAccumulator
- Returns:
- a factor by which total counts should be multiplied
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.