Examples of StandardFacetsAccumulator


Examples of org.apache.lucene.facet.search.StandardFacetsAccumulator

public class SamplingWrapperTest extends BaseSampleTestTopK {

  @Override
  protected StandardFacetsAccumulator getSamplingAccumulator(Sampler sampler, TaxonomyReader taxoReader,
      IndexReader indexReader, FacetSearchParams searchParams) {
    return new SamplingWrapper(new StandardFacetsAccumulator(searchParams, indexReader, taxoReader), sampler);
  }
View Full Code Here

Examples of org.apache.lucene.facet.search.StandardFacetsAccumulator

      final FacetIndexingParams facetIndexingParams) throws IOException {
    int partitionSize = PartitionsUtils.partitionSize(facetIndexingParams, taxonomy);
    final int[][] counts = new int[(int) Math.ceil(taxonomy.getSize()  /(float) partitionSize)][partitionSize];
    FacetSearchParams newSearchParams = new FacetSearchParams(facetIndexingParams, DUMMY_REQ);
      //createAllListsSearchParams(facetIndexingParams,  this.totalCounts);
    StandardFacetsAccumulator sfa = new StandardFacetsAccumulator(newSearchParams, indexReader, taxonomy) {
      @Override
      protected HashMap<CategoryListIterator, Aggregator> getCategoryListMap(
          FacetArrays facetArrays, int partition) throws IOException {
       
        Aggregator aggregator = new CountingAggregator(counts[partition]);
        HashMap<CategoryListIterator, Aggregator> map = new HashMap<CategoryListIterator, Aggregator>();
        for (CategoryListParams clp: facetIndexingParams.getAllCategoryListParams()) {
          map.put(clp.createCategoryListIterator(partition), aggregator);
        }
        return map;
      }
    };
    sfa.setComplementThreshold(StandardFacetsAccumulator.DISABLE_COMPLEMENT);
    sfa.accumulate(ScoredDocIdsUtils.createAllDocsScoredDocIDs(indexReader));
    return new TotalFacetCounts(taxonomy, facetIndexingParams, counts, CreationType.Computed);
  }
View Full Code Here

Examples of org.apache.lucene.facet.search.StandardFacetsAccumulator

      facetSearchParams.addFacetRequest(doctor);
      facetSearchParams.addFacetRequest(cfrb20);
     
      IntArrayAllocator iaa = new IntArrayAllocator(PartitionsUtils.partitionSize(facetSearchParams,tr), 1);
      FloatArrayAllocator faa = new FloatArrayAllocator(PartitionsUtils.partitionSize(facetSearchParams,tr), 1);
      FacetsAccumulator fctExtrctr = new StandardFacetsAccumulator(facetSearchParams, is.getIndexReader(), tr, iaa, faa);
      fctExtrctr.setComplementThreshold(FacetsAccumulator.DISABLE_COMPLEMENT);
      long start = System.currentTimeMillis();

      List<FacetResult> facetResults = fctExtrctr.accumulate(scoredDoc.getScoredDocIDs());

      long end = System.currentTimeMillis();
      if (VERBOSE) {
        System.out.println("Time: " + (end - start));
      }
View Full Code Here

Examples of org.apache.lucene.facet.search.StandardFacetsAccumulator

    sParams.setClCache(clCache);
    for (String dim : dimension) {
      sParams.addFacetRequest(new PerDimCountFacetRequest(
          new CategoryPath(dim), 10));
    }
    FacetsAccumulator acc = new StandardFacetsAccumulator(sParams, reader, taxo);
   
    // no use to test this with complement since at that mode all facets are taken
    acc.setComplementThreshold(FacetsAccumulator.DISABLE_COMPLEMENT);

    List<FacetResult> results = acc.accumulate(allDocs);
    assertEquals("Wrong #results", dimension.length, results.size());

    for (int i = 0; i < results.size(); i++) {
      FacetResult res = results.get(i);
      assertEquals("wrong num-descendants for dimension " + dimension[i],
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.