Examples of CategoryListParams


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

    Map<String,OrdinalPolicy> policies = new HashMap<String,CategoryListParams.OrdinalPolicy>();
    policies.put(CP_B.components[0], OrdinalPolicy.ALL_PARENTS);
    policies.put(CP_C.components[0], OrdinalPolicy.NO_PARENTS);
    policies.put(CP_D.components[0], OrdinalPolicy.NO_PARENTS);
    CategoryListParams clp = new PerDimensionOrdinalPolicy(policies);
    fip = new FacetIndexingParams(clp);
   
    allExpectedCounts = newCounts();
    termExpectedCounts = newCounts();
   
View Full Code Here

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

    Directory taxoDir = newDirectory();
   
    IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
    iwc.setMergePolicy(NoMergePolicy.COMPOUND_FILES); // prevent merges
    IndexWriter indexWriter = new IndexWriter(indexDir, iwc);
    FacetIndexingParams fip = new FacetIndexingParams(new CategoryListParams() {
      @Override
      public CategoryListIterator createCategoryListIterator(int partition) throws IOException {
        return new AssertingCategoryListIterator(super.createCategoryListIterator(partition));
      }
    });
View Full Code Here

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

    Directory dir = newDirectory();
    Directory taxoDir = newDirectory();
    RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
    DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode.CREATE);

    CategoryListParams clp = new CategoryListParams("$facets") {
        @Override
        public OrdinalPolicy getOrdinalPolicy(String fieldName) {
          return OrdinalPolicy.ALL_PARENTS;
        }
      };
View Full Code Here

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

        TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
    // create and open a taxonomy writer
    TaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir, OpenMode.CREATE);

    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(
        Collections.singletonMap(new CategoryPath("Author"), new CategoryListParams("$author")));
    seedIndex(iw, tw, iParams);

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

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

        TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
    // create and open a taxonomy writer
    TaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir, OpenMode.CREATE);

    Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
    paramsMap.put(new CategoryPath("Band"), new CategoryListParams("$music"));
    paramsMap.put(new CategoryPath("Composer"), new CategoryListParams("$music"));
    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(paramsMap);
    seedIndex(iw, tw, iParams);

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

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

        TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
    // create and open a taxonomy writer
    TaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir, OpenMode.CREATE);

    Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
    paramsMap.put(new CategoryPath("Band"), new CategoryListParams("$bands"));
    paramsMap.put(new CategoryPath("Composer"), new CategoryListParams("$composers"));
    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(paramsMap);
    seedIndex(iw, tw, iParams);

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

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

        TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)));
    // create and open a taxonomy writer
    TaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir, OpenMode.CREATE);

    Map<CategoryPath,CategoryListParams> paramsMap = new HashMap<CategoryPath,CategoryListParams>();
    paramsMap.put(new CategoryPath("Band"), new CategoryListParams("$music"));
    paramsMap.put(new CategoryPath("Composer"), new CategoryListParams("$music"));
    paramsMap.put(new CategoryPath("Author"), new CategoryListParams("$literature"));
    PerDimensionIndexingParams iParams = new PerDimensionIndexingParams(paramsMap);

    seedIndex(iw, tw, iParams);

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

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

    Directory indexDir = newDirectory();
    Directory taxoDir = newDirectory();

    TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(taxoDir);
    IndexWriter iw = new IndexWriter(indexDir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
    FacetIndexingParams fip = new FacetIndexingParams(new CategoryListParams() {
      @Override
      public OrdinalPolicy getOrdinalPolicy(String dimension) {
        return OrdinalPolicy.NO_PARENTS;
      }
    });
View Full Code Here

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

    Directory indexDir = newDirectory();
    Directory taxoDir = newDirectory();
   
    TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(taxoDir);
    IndexWriter iw = new IndexWriter(indexDir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
    FacetIndexingParams fip = new PerDimensionIndexingParams(Collections.singletonMap(new CategoryPath("b"), new CategoryListParams("$b")));
   
    FacetFields facetFields = new FacetFields(taxonomyWriter, fip);
    for(int i = atLeast(30); i > 0; --i) {
      Document doc = new Document();
      doc.add(new StringField("f", "v", Store.NO));
View Full Code Here

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

    Directory indexDir = newDirectory();
    Directory taxoDir = newDirectory();
   
    TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(taxoDir);
    IndexWriter iw = new IndexWriter(indexDir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
    FacetIndexingParams fip = new PerDimensionIndexingParams(Collections.singletonMap(new CategoryPath("b"), new CategoryListParams("$b")));
   
    FacetFields facetFields = new FacetFields(taxonomyWriter, fip);
    for(int i = atLeast(30); i > 0; --i) {
      Document doc = new Document();
      doc.add(new StringField("f", "v", Store.NO));
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.