Package org.apache.lucene.facet.search.aggregator

Examples of org.apache.lucene.facet.search.aggregator.Aggregator


    FacetsAccumulator fe = 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()) {
          final CategoryListIterator cli = clIteraor(clCache, clp, indexReader, partition);
          map.put(cli, aggregator);
        }
View Full Code Here


      CategoryListIterator categoryList = entry.getKey();
      if (!categoryList.init()) {
        continue;
      }

      Aggregator categorator = entry.getValue();
      ScoredDocIDsIterator iterator = docids.iterator();
      while (iterator.next()) {
        int docID = iterator.getDocID();
        if (!categoryList.skipTo(docID)) {
          continue;
        }
        categorator.setNextDoc(docID, iterator.getScore());
        long ordinal;
        while ((ordinal = categoryList.nextCategory()) <= Integer.MAX_VALUE) {
          categorator.aggregate((int) ordinal);
        }
      }
    }
  }
View Full Code Here

      int partition) throws IOException {
   
    HashMap<CategoryListIterator, Aggregator> categoryLists = new HashMap<CategoryListIterator, Aggregator>();

    for (FacetRequest facetRequest : searchParams.getFacetRequests()) {
      Aggregator categoryAggregator = facetRequest.createAggregator(
          isUsingComplements, facetArrays, indexReader,  taxonomyReader);

      CategoryListIterator cli =
        facetRequest.createCategoryListIterator(indexReader, taxonomyReader, searchParams, partition);
     
      // get the aggregator
      Aggregator old = categoryLists.put(cli, categoryAggregator);

      if (old != null && !old.equals(categoryAggregator)) {
        // TODO (Facet): create a more meaningful RE class, and throw it.
        throw new RuntimeException(
        "Overriding existing category list with different aggregator. THAT'S A NO NO!");
      }
      // if the aggregator is the same we're covered
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.search.aggregator.Aggregator

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.