Examples of CategoryListParams


Examples of org.apache.lucene.facet.params.CategoryListParams

    }

    final Map<CategoryListParams,Iterable<CategoryPath>> categoryLists = createCategoryListMapping(categories);
    for (Entry<CategoryListParams, Iterable<CategoryPath>> e : categoryLists.entrySet()) {

      CategoryListParams clp = e.getKey();
      String dvField = clp.field + SortedSetDocValuesReaderState.FACET_FIELD_EXTENSION;

      // Add sorted-set DV fields, one per value:
      for(CategoryPath cp : e.getValue()) {
        if (cp.length != 2) {
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    CategoryAssociationsContainer categoryAssociations = (CategoryAssociationsContainer) categories;
    HashMap<CategoryListParams,Iterable<CategoryPath>> categoryLists =
        new HashMap<CategoryListParams,Iterable<CategoryPath>>();
    for (CategoryPath cp : categories) {
      // each category may be indexed under a different field, so add it to the right list.
      CategoryListParams clp = indexingParams.getCategoryListParams(cp);
      CategoryAssociationsContainer clpContainer = (CategoryAssociationsContainer) categoryLists.get(clp);
      if (clpContainer == null) {
        clpContainer = new CategoryAssociationsContainer();
        categoryLists.put(clp, clpContainer);
      }
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

*/
public final class DrillDownQuery extends Query {

  /** Return a drill-down {@link Term} for a category. */
  public static Term term(FacetIndexingParams iParams, CategoryPath path) {
    CategoryListParams clp = iParams.getCategoryListParams(path);
    char[] buffer = new char[path.fullPathLength()];
    iParams.drillDownTermText(path, buffer);
    return new Term(clp.field, String.valueOf(buffer));
  }
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    aggregators.get(clp).aggregate(matchingDocs, clp, facetArrays);
  }
 
  @Override
  public void rollupValues(FacetRequest fr, int ordinal, int[] children, int[] siblings, FacetArrays facetArrays) {
    CategoryListParams clp = fip.getCategoryListParams(fr.categoryPath);
    aggregators.get(clp).rollupValues(fr, ordinal, children, siblings, facetArrays);
  }
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    return false;
  }

  @Override
  public OrdinalValueResolver createOrdinalValueResolver(FacetRequest facetRequest, FacetArrays arrays) {
    CategoryListParams clp = fip.getCategoryListParams(facetRequest.categoryPath);
    return aggregators.get(clp).createOrdinalValueResolver(facetRequest, arrays);
  }
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    FacetIndexingParams fip = fipPerPartitionSize.get(partSize);
    if (fip == null) {
      // randomize OrdinalPolicy. Since not all Collectors / Accumulators
      // support NO_PARENTS, don't include it.
      // TODO: once all code paths support NO_PARENTS, randomize it too.
      CategoryListParams randomOP = new CategoryListParams() {
        final OrdinalPolicy op = random().nextBoolean() ? OrdinalPolicy.ALL_BUT_DIMENSION : OrdinalPolicy.ALL_PARENTS;
        @Override
        public OrdinalPolicy getOrdinalPolicy(String dimension) {
          return forceAllParents ? OrdinalPolicy.ALL_PARENTS : op;
        }
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

 
  /** Returns a {@link CategoryListParams} with random {@link IntEncoder}. */
  public static CategoryListParams randomCategoryListParams(String field) {
    Random random = random();
    final IntEncoder encoder = ENCODERS[random.nextInt(ENCODERS.length)];
    return new CategoryListParams(field) {
      @Override
      public IntEncoder createEncoder() {
        return encoder;
      }
    };
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    requests.add(new CountFacetRequest(new CategoryPath("b"), 10));
    requests.add(new CountFacetRequest(new CategoryPath("b" + FacetIndexingParams.DEFAULT_FACET_DELIM_CHAR), 10));

    final boolean doDimCount = random().nextBoolean();

    CategoryListParams clp = new CategoryListParams() {
        @Override
        public OrdinalPolicy getOrdinalPolicy(String dimension) {
          return doDimCount ? OrdinalPolicy.NO_PARENTS : OrdinalPolicy.ALL_BUT_DIMENSION;
        }
      };
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    }
    HashMap<CategoryListParams,Iterable<CategoryPath>> categoryLists =
        new HashMap<CategoryListParams,Iterable<CategoryPath>>();
    for (CategoryPath cp : categories) {
      // each category may be indexed under a different field, so add it to the right list.
      CategoryListParams clp = indexingParams.getCategoryListParams(cp);
      List<CategoryPath> list = (List<CategoryPath>) categoryLists.get(clp);
      if (list == null) {
        list = new ArrayList<CategoryPath>();
        categoryLists.put(clp, list);
      }
View Full Code Here

Examples of org.apache.lucene.facet.params.CategoryListParams

    // for each CLP we add a different field for drill-down terms as well as for
    // counting list data.
    IntsRef ordinals = new IntsRef(32); // should be enough for most common applications
    for (Entry<CategoryListParams, Iterable<CategoryPath>> e : categoryLists.entrySet()) {
      final CategoryListParams clp = e.getKey();
      final String field = clp.field;

      // build category list data
      ordinals.length = 0; // reset
      int maxNumOrds = 0;
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.