Examples of CategoryListParams


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

    return true;
  }

  protected CategoryListPayloadStream getPayloadStream(
      CategoryPath categoryPath, int ordinal) throws IOException {
    CategoryListParams clParams = this.indexingParams.getCategoryListParams(categoryPath);
    String name = PartitionsUtils.partitionNameByOrdinal(indexingParams, clParams, ordinal);
    CategoryListPayloadStream fps = payloadStreamsByName.get(name);
    if (fps == null) {
      IntEncoder encoder = clParams.createEncoder();
      fps = new CategoryListPayloadStream(encoder);
      payloadStreamsByName.put(name, fps);
    }
    return fps;
  }
View Full Code Here

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

  /**
   * Return a term for drilling down into a category.
   */
  public static final Term term(FacetIndexingParams iParams, CategoryPath path) {
    CategoryListParams clp = iParams.getCategoryListParams(path);
    char[] buffer = new char[path.charsNeededForFullPath()];
    iParams.drillDownTermText(path, buffer);
    return clp.getTerm().createTerm(String.valueOf(buffer));
  }
View Full Code Here

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

      }
    }
   
    @Override
    public PayloadProcessor getProcessor(Term term) throws IOException {
      CategoryListParams params = termMap.get(term);
      if (params == null) {
        return null;
      }
      return new FacetsPayloadProcessor(params, ordinalMap);
    }
View Full Code Here

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

   */
  public CategoryListIterator createCategoryListIterator(IndexReader reader,
      TaxonomyReader taxo, FacetSearchParams sParams, int partition)
      throws IOException {
    CategoryListCache clCache = sParams.getClCache();
    CategoryListParams clParams = sParams.getFacetIndexingParams().getCategoryListParams(categoryPath);
    if (clCache!=null) {
      CategoryListData clData = clCache.get(clParams);
      if (clData!=null) {
        return clData.iterator(partition);
      }
    }
    return clParams.createCategoryListIterator(reader, partition);
  }
View Full Code Here

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

  private void doTestCLParamMultiIteratorsByRequest(boolean cacheCLI) throws Exception,
      CorruptIndexException, IOException {
    // Create a CLP which generates different CLIs according to the
    // FacetRequest's dimension
    CategoryListParams clp = new CategoryListParams();
    FacetIndexingParams iParams = new DefaultFacetIndexingParams(clp);
    Directory indexDir = newDirectory();
    Directory taxoDir = newDirectory();
    populateIndex(iParams, indexDir, taxoDir);
View Full Code Here

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

  private static Directory dir;
  private static Directory taxoDir;
 
  public DrillDownTest() throws IOException {
    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams();
    CategoryListParams aClParams = new CategoryListParams(new Term("testing_facets_a", "a"));
    CategoryListParams bClParams = new CategoryListParams(new Term("testing_facets_b", "b"));
   
    iParams.addCategoryListParams(new CategoryPath("a"), aClParams);
    iParams.addCategoryListParams(new CategoryPath("b"), bClParams);
   
    nonDefaultParams = new FacetSearchParams(iParams);
View Full Code Here

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

    TaxonomyWriter tw = new LuceneTaxonomyWriter(dirs[0][1],
        OpenMode.CREATE);

    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams();
    iParams.addCategoryListParams(new CategoryPath("Author"),
        new CategoryListParams(new Term("$author", "Authors")));
    seedIndex(iw, tw, iParams);

    IndexReader ir = iw.getReader();
    tw.commit();
View Full Code Here

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

    TaxonomyWriter tw = new LuceneTaxonomyWriter(dirs[0][1],
        OpenMode.CREATE);

    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams();
    iParams.addCategoryListParams(new CategoryPath("Band"),
        new CategoryListParams(new Term("$music", "Bands")));
    iParams.addCategoryListParams(new CategoryPath("Composer"),
        new CategoryListParams(new Term("$music", "Composers")));
    seedIndex(iw, tw, iParams);

    IndexReader ir = iw.getReader();
    tw.commit();
View Full Code Here

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

    // create and open a taxonomy writer
    TaxonomyWriter tw = new LuceneTaxonomyWriter(dirs[0][1], OpenMode.CREATE);

    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams();
    iParams.addCategoryListParams(new CategoryPath("Band"),
        new CategoryListParams(new Term("$bands", "Bands")));
    iParams.addCategoryListParams(new CategoryPath("Composer"),
        new CategoryListParams(new Term("$composers", "Composers")));
    seedIndex(iw, tw, iParams);

    IndexReader ir = iw.getReader();
    tw.commit();
View Full Code Here

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

    TaxonomyWriter tw = new LuceneTaxonomyWriter(dirs[0][1],
        OpenMode.CREATE);

    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams();
    iParams.addCategoryListParams(new CategoryPath("Band"),
        new CategoryListParams(new Term("$music", "music")));
    iParams.addCategoryListParams(new CategoryPath("Composer"),
        new CategoryListParams(new Term("$music", "music")));
    iParams.addCategoryListParams(new CategoryPath("Author"),
        new CategoryListParams(new Term("$literature", "Authors")));

    seedIndex(iw, tw, iParams);

    IndexReader ir = iw.getReader();
    tw.commit();
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.