## org.apache.lucene.facet.search.sampling
Class RandomSampler

    java.lang.Object
      org.apache.lucene.facet.search.sampling.Sampler
          org.apache.lucene.facet.search.sampling.RandomSampler

    public class RandomSampler

extends Sampler

Simple random sampler

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.lucene.facet.search.sampling.Sampler
`Sampler.SampleResult`

Field Summary

Fields inherited from class org.apache.lucene.facet.search.sampling.Sampler
`samplingParams`

Constructor Summary
`RandomSampler()`
`RandomSampler(SamplingParams params, Random random)`

Method Summary
`protected Sampler.SampleResult` `createSample(ScoredDocIDs docids, int actualSize, int sampleSetSize)` Create and return a sample of the input set

Methods inherited from class org.apache.lucene.facet.search.sampling.Sampler
`getSampleFixer, getSampleSet, getSamplingParams, overSampledSearchParams, shouldSample, trimResult`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RandomSampler

    public RandomSampler()

### RandomSampler

    public RandomSampler(SamplingParams params,
                         Random random)
                  throws IllegalArgumentException

Throws:
  `IllegalArgumentException`

Method Detail

### createSample

    protected Sampler.SampleResult createSample(ScoredDocIDs docids,
                                                int actualSize,
                                                int sampleSetSize)
                                         throws IOException

  Description copied from class: `Sampler`
  Create and return a sample of the input set

  Specified by:
    `createSample` in class `Sampler`
  Parameters:
    `docids` - input set out of which a sample is to be created
    `actualSize` - original size of set, prior to sampling
    `sampleSetSize` - required size of sample set
  Returns:
    sample of the input set in the required size
  Throws:
    `IOException`