org.apache.lucene.facet.sampling
Class SamplingWrapper

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

public class SamplingWrapper
extends OldFacetsAccumulator

Wrap any Facets Accumulator with sampling.

Note: Sampling accumulation (Accumulation over a sampled-set of the results), does not guarantee accurate values for FacetResult.getNumValidDescendants().

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
SamplingWrapper(OldFacetsAccumulator delegee, Sampler sampler)
           
 
Method Summary
 List<FacetResult> accumulate(ScoredDocIDs docids)
           
 double getComplementThreshold()
          Returns the complement threshold.
 void setComplementThreshold(double complementThreshold)
          Set the complement threshold.
 
Methods inherited from class org.apache.lucene.facet.old.OldFacetsAccumulator
accumulate, actualDocsToAccumulate, createAggregator, createFacetResultsHandler, createOrdinalValueResolver, getCategoryListMap, getTotalCountsFactor, isUsingComplements, mayComplement, 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

SamplingWrapper

public SamplingWrapper(OldFacetsAccumulator delegee,
                       Sampler sampler)
Method Detail

accumulate

public List<FacetResult> accumulate(ScoredDocIDs docids)
                             throws IOException
Overrides:
accumulate in class OldFacetsAccumulator
Throws:
IOException

getComplementThreshold

public double getComplementThreshold()
Description copied from class: OldFacetsAccumulator
Returns the complement threshold.

Overrides:
getComplementThreshold in class OldFacetsAccumulator
See Also:
OldFacetsAccumulator.setComplementThreshold(double)

setComplementThreshold

public void setComplementThreshold(double complementThreshold)
Description copied from class: OldFacetsAccumulator
Set the complement threshold. This threshold will dictate whether the complements optimization is applied. The optimization is to count for less documents. It is useful when the same FacetSearchParams are used for varying sets of documents. The first time complements is used the "total counts" are computed - counting for all the documents in the collection. Then, only the complementing set of documents is considered, and used to decrement from the overall counts, thereby walking through less documents, which is faster.

For the default settings see OldFacetsAccumulator.DEFAULT_COMPLEMENT_THRESHOLD.

To forcing complements in all cases pass OldFacetsAccumulator.FORCE_COMPLEMENT. This is mostly useful for testing purposes, as forcing complements when only tiny fraction of available documents match the query does not make sense and would incur performance degradations.

To disable complements pass OldFacetsAccumulator.DISABLE_COMPLEMENT.

Overrides:
setComplementThreshold in class OldFacetsAccumulator
Parameters:
complementThreshold - the complement threshold to set
See Also:
OldFacetsAccumulator.getComplementThreshold()


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.