Package org.apache.lucene.facet.sampling

Examples of org.apache.lucene.facet.sampling.Sampler$OverSampledFacetRequest


    sampleParams.setSamplingThreshold(100);
    sampleParams.setOversampleFactor(1.0d);
    if (random().nextBoolean()) {
      sampleParams.setSampleFixer(new TakmiSampleFixer(indexReader, taxoReader, fsp));
    }
    final Sampler sampler = new RandomSampler(sampleParams, random());
   
    TaxonomyFacetsAccumulator[] accumulators = new TaxonomyFacetsAccumulator[] {
      new TaxonomyFacetsAccumulator(fsp, indexReader, taxoReader),
      new OldFacetsAccumulator(fsp, indexReader, taxoReader),
      new SamplingAccumulator(sampler, fsp, indexReader, taxoReader),
View Full Code Here


  /** search reader <code>r</code>*/
  private FacetResult searchWithFacets(IndexReader r, TaxonomyReader tr, FacetSearchParams fsp,
      final SamplingParams params) throws IOException {
    // a FacetsCollector with a sampling accumulator
    Sampler sampler = new RandomSampler(params, random());
    StandardFacetsAccumulator sfa = new SamplingAccumulator(sampler, fsp, r, tr);
    FacetsCollector fcWithSampling = FacetsCollector.create(sfa);
   
    IndexSearcher s = new IndexSearcher(r);
    s.search(new MatchAllDocsQuery(), fcWithSampling);
View Full Code Here

    sampleParams.setSamplingThreshold(100);
    sampleParams.setOversampleFactor(1.0d);
    if (random().nextBoolean()) {
      sampleParams.setSampleFixer(new TakmiSampleFixer(indexReader, taxoReader, fsp));
    }
    final Sampler sampler = new RandomSampler(sampleParams, random());
   
    TaxonomyFacetsAccumulator[] accumulators = new TaxonomyFacetsAccumulator[] {
      new TaxonomyFacetsAccumulator(fsp, indexReader, taxoReader),
      new OldFacetsAccumulator(fsp, indexReader, taxoReader),
      new SamplingAccumulator(sampler, fsp, indexReader, taxoReader),
View Full Code Here

        // try several times in case of failure, because the test has a chance to fail
        // if the top K facets are not sufficiently common with the sample set
        for (int nTrial = 0; nTrial < RETRIES; nTrial++) {
          try {
            // complement with sampling!
            final Sampler sampler = createSampler(nTrial, useRandomSampler, samplingSearchParams);
           
            assertSampling(expectedResults, q, sampler, samplingSearchParams, false);
            assertSampling(expectedResults, q, sampler, samplingSearchParams, true);
           
            break; // succeeded
View Full Code Here

    samplingParams.setSampleRatio(0.8 * retryFactor);
    samplingParams.setMinSampleSize((int) (100 * retryFactor));
    samplingParams.setMaxSampleSize((int) (10000 * retryFactor));
    samplingParams.setSamplingThreshold(11000); //force sampling

    Sampler sampler = useRandomSampler ?
        new RandomSampler(samplingParams, new Random(random().nextLong())) :
          new RepeatableSampler(samplingParams);
    return sampler;
  }
View Full Code Here

    sampleParams.setSamplingThreshold(100);
    sampleParams.setOversampleFactor(1.0d);
    if (random().nextBoolean()) {
      sampleParams.setSampleFixer(new TakmiSampleFixer(indexReader, taxoReader, fsp));
    }
    final Sampler sampler = new RandomSampler(sampleParams, random());
   
    FacetsAccumulator[] accumulators = new FacetsAccumulator[] {
      new FacetsAccumulator(fsp, indexReader, taxoReader),
      new StandardFacetsAccumulator(fsp, indexReader, taxoReader),
      new SamplingAccumulator(sampler, fsp, indexReader, taxoReader),
View Full Code Here

  /** search reader <code>r</code>*/
  private FacetResult searchWithFacets(IndexReader r, TaxonomyReader tr, FacetSearchParams fsp,
      final SamplingParams params) throws IOException {
    // a FacetsCollector with a sampling accumulator
    Sampler sampler = new RandomSampler(params, random());
    StandardFacetsAccumulator sfa = new SamplingAccumulator(sampler, fsp, r, tr);
    FacetsCollector fcWithSampling = FacetsCollector.create(sfa);
   
    IndexSearcher s = newSearcher(r);
    s.search(new MatchAllDocsQuery(), fcWithSampling);
View Full Code Here

        // try several times in case of failure, because the test has a chance to fail
        // if the top K facets are not sufficiently common with the sample set
        for (int nTrial = 0; nTrial < RETRIES; nTrial++) {
          try {
            // complement with sampling!
            final Sampler sampler = createSampler(nTrial, useRandomSampler);
           
            assertSampling(expectedResults, q, sampler, samplingSearchParams, false);
            assertSampling(expectedResults, q, sampler, samplingSearchParams, true);
           
            break; // succeeded
View Full Code Here

    samplingParams.setMinSampleSize((int) (100 * retryFactor));
    samplingParams.setMaxSampleSize((int) (10000 * retryFactor));
    samplingParams.setOversampleFactor(5.0 * retryFactor);
    samplingParams.setSamplingThreshold(11000); //force sampling

    Sampler sampler = useRandomSampler ?
        new RandomSampler(samplingParams, new Random(random().nextLong())) :
          new RepeatableSampler(samplingParams);
    return sampler;
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.sampling.Sampler$OverSampledFacetRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.