org.apache.lucene.facet.sampling
public class SamplingParams extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_SAMPLE_SIZE
Default maximum size of sample.
|
static int |
DEFAULT_MIN_SAMPLE_SIZE
Default minimum size of sample.
|
static double |
DEFAULT_OVERSAMPLE_FACTOR
Default factor by which more results are requested over the sample set.
|
static double |
DEFAULT_SAMPLE_RATIO
Default ratio between size of sample to original size of document set.
|
static int |
DEFAULT_SAMPLING_THRESHOLD
Default sampling threshold, if number of results is less than this number - no sampling will take place
|
Constructor and Description |
---|
SamplingParams() |
Modifier and Type | Method and Description |
---|---|
int |
getMaxSampleSize()
Return the maxSampleSize.
|
int |
getMinSampleSize()
Return the minSampleSize.
|
double |
getOversampleFactor()
Return the oversampleFactor.
|
SampleFixer |
getSampleFixer() |
double |
getSampleRatio() |
int |
getSamplingThreshold()
Return the samplingThreshold.
|
void |
setMaxSampleSize(int maxSampleSize) |
void |
setMinSampleSize(int minSampleSize) |
void |
setOversampleFactor(double oversampleFactor) |
void |
setSampleFixer(SampleFixer sampleFixer)
Set a
SampleFixer to be used while fixing the sampled results. |
void |
setSampleRatio(double sampleRatio) |
void |
setSamplingThreshold(int samplingThreshold)
Set a sampling-threshold
|
boolean |
shouldOverSample()
Returns whether over-sampling should be done.
|
boolean |
validate()
Check validity of sampling settings, making sure that
minSampleSize <= maxSampleSize <= samplingThreshold
0 < samplingRatio <= 1
|
public static final double DEFAULT_OVERSAMPLE_FACTOR
getOversampleFactor()
,
Constant Field Valuespublic static final double DEFAULT_SAMPLE_RATIO
public static final int DEFAULT_MAX_SAMPLE_SIZE
public static final int DEFAULT_MIN_SAMPLE_SIZE
public static final int DEFAULT_SAMPLING_THRESHOLD
getSampleRatio()
,
Constant Field Valuespublic final int getMaxSampleSize()
public final int getMinSampleSize()
public final double getSampleRatio()
Sampler.getSampleSet(org.apache.lucene.facet.old.ScoredDocIDs)
public final int getSamplingThreshold()
public void setMaxSampleSize(int maxSampleSize)
maxSampleSize
- the maxSampleSize to setgetMaxSampleSize()
public void setMinSampleSize(int minSampleSize)
minSampleSize
- the minSampleSize to setgetMinSampleSize()
public void setSampleRatio(double sampleRatio)
sampleRatio
- the sampleRatio to setgetSampleRatio()
public void setSamplingThreshold(int samplingThreshold)
getSamplingThreshold()
public boolean validate()
minSampleSize <= maxSampleSize <= samplingThreshold
0 < samplingRatio <= 1
public final double getOversampleFactor()
TakmiSampleFixer
. When this value is smaller than 1, it is
ignored and no oversampling takes place.public void setOversampleFactor(double oversampleFactor)
oversampleFactor
- the oversampleFactor to setgetOversampleFactor()
public SampleFixer getSampleFixer()
SampleFixer
to be used while fixing the sampled results, if
null
no fixing will be performedpublic void setSampleFixer(SampleFixer sampleFixer)
SampleFixer
to be used while fixing the sampled results.
null
means no fixing will be performedpublic boolean shouldOverSample()
true
when getSampleFixer()
is not null
and
getOversampleFactor()
> 1, false
otherwise.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.