Examples of shouldAdd()


Examples of org.apache.lucene.facet.index.categorypolicy.NonTopLevelPathPolicy.shouldAdd()

      taxonomy.addCategory(nonTopLevelPaths[i]);
    }
    // check ordinal policy
    PathPolicy pathPolicy = new NonTopLevelPathPolicy();
    assertFalse("top level path policy should not match root",
        pathPolicy.shouldAdd(new CategoryPath()));
    for (int i = 0; i < 10; i++) {
      assertFalse("top level path policy should not match "
          + topLevelPaths[i],
          pathPolicy.shouldAdd(topLevelPaths[i]));
    }
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.NonTopLevelPathPolicy.shouldAdd()

    assertFalse("top level path policy should not match root",
        pathPolicy.shouldAdd(new CategoryPath()));
    for (int i = 0; i < 10; i++) {
      assertFalse("top level path policy should not match "
          + topLevelPaths[i],
          pathPolicy.shouldAdd(topLevelPaths[i]));
    }
    for (int i = 0; i < 300; i++) {
      assertTrue("top level path policy should match "
          + nonTopLevelPaths[i],
          pathPolicy.shouldAdd(nonTopLevelPaths[i]));
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.NonTopLevelPathPolicy.shouldAdd()

          pathPolicy.shouldAdd(topLevelPaths[i]));
    }
    for (int i = 0; i < 300; i++) {
      assertTrue("top level path policy should match "
          + nonTopLevelPaths[i],
          pathPolicy.shouldAdd(nonTopLevelPaths[i]));
    }
    taxonomy.close();
    dir.close();
  }
}
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.NonTopLevelPathPolicy.shouldAdd()

      taxonomy.addCategory(nonTopLevelPaths[i]);
    }
    // check ordinal policy
    PathPolicy pathPolicy = new NonTopLevelPathPolicy();
    assertFalse("top level path policy should not match root",
        pathPolicy.shouldAdd(new CategoryPath()));
    for (int i = 0; i < 10; i++) {
      assertFalse("top level path policy should not match "
          + topLevelPaths[i],
          pathPolicy.shouldAdd(topLevelPaths[i]));
    }
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.NonTopLevelPathPolicy.shouldAdd()

    assertFalse("top level path policy should not match root",
        pathPolicy.shouldAdd(new CategoryPath()));
    for (int i = 0; i < 10; i++) {
      assertFalse("top level path policy should not match "
          + topLevelPaths[i],
          pathPolicy.shouldAdd(topLevelPaths[i]));
    }
    for (int i = 0; i < 300; i++) {
      assertTrue("top level path policy should match "
          + nonTopLevelPaths[i],
          pathPolicy.shouldAdd(nonTopLevelPaths[i]));
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.NonTopLevelPathPolicy.shouldAdd()

          pathPolicy.shouldAdd(topLevelPaths[i]));
    }
    for (int i = 0; i < 300; i++) {
      assertTrue("top level path policy should match "
          + nonTopLevelPaths[i],
          pathPolicy.shouldAdd(nonTopLevelPaths[i]));
    }
    taxonomy.close();
    dir.close();
  }
}
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy.shouldAdd()

  @Test
  public void testDefaultOrdinalPolicy() {
    // check ordinal policy
    OrdinalPolicy ordinalPolicy = new DefaultOrdinalPolicy();
    assertFalse("default ordinal policy should not match root", ordinalPolicy
        .shouldAdd(TaxonomyReader.ROOT_ORDINAL));
    for (int i = 0; i < 300; i++) {
      int ordinal = 1 + random.nextInt(Integer.MAX_VALUE - 1);
      assertTrue("default ordinal policy should match " + ordinal,
          ordinalPolicy.shouldAdd(ordinal));
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy.shouldAdd()

    assertFalse("default ordinal policy should not match root", ordinalPolicy
        .shouldAdd(TaxonomyReader.ROOT_ORDINAL));
    for (int i = 0; i < 300; i++) {
      int ordinal = 1 + random.nextInt(Integer.MAX_VALUE - 1);
      assertTrue("default ordinal policy should match " + ordinal,
          ordinalPolicy.shouldAdd(ordinal));
    }
  }

  @Test
  public void testNonTopLevelOrdinalPolicy() throws Exception {
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy.shouldAdd()

          components));
    }
    // check ordinal policy
    OrdinalPolicy ordinalPolicy = new NonTopLevelOrdinalPolicy();
    ordinalPolicy.init(taxonomy);
    assertFalse("top level ordinal policy should not match root", ordinalPolicy
        .shouldAdd(TaxonomyReader.ROOT_ORDINAL));
    for (int i = 0; i < 10; i++) {
      assertFalse("top level ordinal policy should not match "
          + topLevelOrdinals[i],
          ordinalPolicy.shouldAdd(topLevelOrdinals[i]));
View Full Code Here

Examples of org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy.shouldAdd()

    assertFalse("top level ordinal policy should not match root", ordinalPolicy
        .shouldAdd(TaxonomyReader.ROOT_ORDINAL));
    for (int i = 0; i < 10; i++) {
      assertFalse("top level ordinal policy should not match "
          + topLevelOrdinals[i],
          ordinalPolicy.shouldAdd(topLevelOrdinals[i]));
    }
    for (int i = 0; i < 300; i++) {
      assertTrue("top level ordinal policy should match "
          + nonTopLevelOrdinals[i],
          ordinalPolicy.shouldAdd(nonTopLevelOrdinals[i]));
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.