org.apache.lucene.facet.sampling
Class SamplingAccumulator

java.lang.Object
  extended by org.apache.lucene.facet.search.FacetsAccumulator
      extended by org.apache.lucene.facet.search.TaxonomyFacetsAccumulator
          extended by org.apache.lucene.facet.old.OldFacetsAccumulator
              extended by org.apache.lucene.facet.sampling.SamplingAccumulator

public class SamplingAccumulator
extends OldFacetsAccumulator

Facets accumulation with sampling.

Note two major differences between this class and SamplingWrapper:

  1. Latter can wrap any other FacetsAccumulator while this class directly extends OldFacetsAccumulator.
  2. 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.

Field Summary
 
Fields inherited from class org.apache.lucene.facet.old.OldFacetsAccumulator
DEFAULT_COMPLEMENT_THRESHOLD, DISABLE_COMPLEMENT, FORCE_COMPLEMENT, isUsingComplements, maxPartitions, partitionSize
 
Fields inherited from class org.apache.lucene.facet.search.TaxonomyFacetsAccumulator
facetArrays, indexReader, taxonomyReader
 
Fields inherited from class org.apache.lucene.facet.search.FacetsAccumulator
searchParams
 
Constructor Summary
SamplingAccumulator(Sampler sampler, FacetSearchParams searchParams, IndexReader indexReader, TaxonomyReader taxonomyReader)
          Constructor...
SamplingAccumulator(Sampler sampler, FacetSearchParams searchParams, IndexReader indexReader, TaxonomyReader taxonomyReader, FacetArrays facetArrays)
           
 
Method Summary
 List<FacetResult> accumulate(ScoredDocIDs docids)
           
protected  ScoredDocIDs actualDocsToAccumulate(ScoredDocIDs docids)
          Set the actual set of documents over which accumulation should take place.
protected  double getTotalCountsFactor()
          Expert: factor by which counts should be multiplied when initializing the count arrays from total counts.
 
Methods inherited from class org.apache.lucene.facet.old.OldFacetsAccumulator
accumulate, createAggregator, createFacetResultsHandler, createOrdinalValueResolver, getCategoryListMap, getComplementThreshold, isUsingComplements, mayComplement, setComplementThreshold, shouldComplement
 
Methods inherited from class org.apache.lucene.facet.search.TaxonomyFacetsAccumulator
getAggregator, groupRequests, requiresDocScores
 
Methods inherited from class org.apache.lucene.facet.search.FacetsAccumulator
create, create, emptyResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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...

Method Detail

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.