Package org.apache.lucene.facet.search

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


    // every category has a different type of association, so use chain their
    // respective aggregators.
    final Map<CategoryPath,FacetsAggregator> aggregators = new HashMap<CategoryPath,FacetsAggregator>();
    aggregators.put(tags, new SumIntAssociationFacetsAggregator());
    aggregators.put(genre, new SumFloatAssociationFacetsAggregator());
    FacetsAccumulator fa = new FacetsAccumulator(fsp, indexReader, taxoReader) {
      @Override
      public FacetsAggregator getAggregator() {
        return new MultiAssociationsFacetsAggregator(aggregators);
      }
    };
View Full Code Here


      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

    FacetsCollector samplingFC = new FacetsCollector(samplingSearchParams, indexReader, taxoReader) {
      @Override
      protected FacetsAccumulator initFacetsAccumulator(
          FacetSearchParams facetSearchParams, IndexReader indexReader,
          TaxonomyReader taxonomyReader) {
        FacetsAccumulator acc = getSamplingAccumulator(sampler, taxonomyReader, indexReader, facetSearchParams);
        acc.setComplementThreshold(complement ? FacetsAccumulator.FORCE_COMPLEMENT : FacetsAccumulator.DISABLE_COMPLEMENT);
        return acc;
      }
    };
    return samplingFC;
  }
View Full Code Here

    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

Related Classes of org.apache.lucene.facet.search.FacetsAccumulator

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.