Package org.apache.lucene.facet.search

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


  }

  @Override
  public FacetsAggregator getAggregator() {

    return new FacetsAggregator() {

      @Override
      public void aggregate(MatchingDocs matchingDocs, CategoryListParams clp, FacetArrays facetArrays) throws IOException {

        AtomicReader reader = matchingDocs.context.reader();
View Full Code Here


  }

  @Override
  public List<FacetResult> accumulate(List<MatchingDocs> matchingDocs) throws IOException {

    FacetsAggregator aggregator = getAggregator();
    for (CategoryListParams clp : getCategoryLists()) {
      for (MatchingDocs md : matchingDocs) {
        aggregator.aggregate(md, clp, facetArrays);
      }
    }

    // compute top-K
    List<FacetResult> results = new ArrayList<FacetResult>();
View Full Code Here

    }

    private List<FacetResult> accumulate() throws IOException {
       
        // aggregate facets per category list (usually only one category list)
        FacetsAggregator aggregator = getAggregator();
        for (CategoryListParams clp : getCategoryLists()) {
            for (MatchingDocs md : matchingDocs) {
                aggregator.aggregate(md, clp, facetArrays);
            }
        }

        ParallelTaxonomyArrays arrays = taxonomyReader.getParallelTaxonomyArrays();

        // compute top-K
        final int[] children = arrays.children();
        final int[] siblings = arrays.siblings();
        List<FacetResult> res = new ArrayList<>();
        for (FacetRequest fr : searchParams.facetRequests) {
            int rootOrd = taxonomyReader.getOrdinal(fr.categoryPath);
            // category does not exist
            if (rootOrd == TaxonomyReader.INVALID_ORDINAL) {
                // Add empty FacetResult
                res.add(emptyResult(rootOrd, fr));
                continue;
            }
            CategoryListParams clp = searchParams.indexingParams.getCategoryListParams(fr.categoryPath);
            // someone might ask to aggregate ROOT category
            if (fr.categoryPath.length > 0) {
                OrdinalPolicy ordinalPolicy = clp.getOrdinalPolicy(fr.categoryPath.components[0]);
                if (ordinalPolicy == OrdinalPolicy.NO_PARENTS) {
                    // rollup values
                    aggregator.rollupValues(fr, rootOrd, children, siblings, facetArrays);
                }
            }

            FacetResultsHandler frh = createFacetResultsHandler(fr);
            res.add(frh.compute());
View Full Code Here

  }

  @Override
  public FacetsAggregator getAggregator() {

    return new FacetsAggregator() {

      @Override
      public void aggregate(MatchingDocs matchingDocs, CategoryListParams clp, FacetArrays facetArrays) throws IOException {

        SortedSetDocValues segValues = matchingDocs.context.reader().getSortedSetDocValues(field);
View Full Code Here

  }

  @Override
  public List<FacetResult> accumulate(List<MatchingDocs> matchingDocs) throws IOException {

    FacetsAggregator aggregator = getAggregator();
    for (CategoryListParams clp : getCategoryLists()) {
      for (MatchingDocs md : matchingDocs) {
        aggregator.aggregate(md, clp, facetArrays);
      }
    }

    // compute top-K
    List<FacetResult> results = new ArrayList<FacetResult>();
View Full Code Here

TOP

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

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.