Package org.apache.lucene.facet.params

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


  @Test
  public void testCountWithdepthUsingSampling() throws Exception, IOException {
    Directory indexDir = newDirectory();
    Directory taxoDir = newDirectory();
   
    FacetIndexingParams fip = new FacetIndexingParams(randomCategoryListParams());
   
    // index 100 docs, each with one category: ["root", docnum/10, docnum]
    // e.g. root/8/87
    index100Docs(indexDir, taxoDir, fip);
   
View Full Code Here


    boolean useRandomSampler = random().nextBoolean();
    for (int partitionSize : partitionSizes) {
      try {
        // complements return counts for all ordinals, so force ALL_PARENTS indexing
        // so that it's easier to compare
        FacetIndexingParams fip = getFacetIndexingParams(partitionSize, true);
        initIndex(fip);
        // Get all of the documents and run the query, then do different
        // facet counts and compare to control
        Query q = new TermQuery(new Term(CONTENT_FIELD, BETA)); // 90% of the docs
       
View Full Code Here

      if (VERBOSE) {
        System.out.println("Partition Size: " + partitionSize);
      }
     
      final int pSize = partitionSize;
      FacetIndexingParams iParams = new FacetIndexingParams() {
        @Override
        public int getPartitionSize() {
          return pSize;
        }
      };
View Full Code Here

        @Override
        public OrdinalPolicy getOrdinalPolicy(String fieldName) {
          return OrdinalPolicy.ALL_PARENTS;
        }
      };
    FacetIndexingParams fip = new FacetIndexingParams(clp);

    FacetFields facetFields = new FacetFields(taxoWriter, fip);

    Document doc = new Document();
    doc.add(newTextField("field", "text", Field.Store.NO));
View Full Code Here

   * also when some facets have the same counts.
   */
  @Test
  public void testTopCountsOrder() throws Exception {
    for (int partitionSize : partitionSizes) {
      FacetIndexingParams fip = getFacetIndexingParams(partitionSize);
      initIndex(fip);
     
      /*
       * Try out faceted search in it's most basic form (no sampling nor complement
       * that is). In this test lots (and lots..) of randomly generated data is
View Full Code Here

    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();
   
    // segment w/ no categories
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.params.FacetIndexingParams

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.