Examples of AssociationFloatProperty


Examples of org.apache.lucene.facet.enhancements.association.AssociationFloatProperty

    assertEquals("Wrong association for property", 8, aa1.getAssociation());
  }

  @Test
  public void testAssociationFloatProperty() throws FacetException {
    AssociationFloatProperty aa1 = new AssociationFloatProperty(5);
    AssociationFloatProperty aa2 = new AssociationFloatProperty(3);
    assertEquals("Wrong association for property", 5.0, aa1.getFloatAssociation(), 0.00001);
    assertEquals("Wrong association for property", 3.0, aa2.getFloatAssociation(), 0.00001);
    aa1.merge(aa2);
    assertEquals("Wrong association for property", 8.0, aa1.getFloatAssociation(), 0.00001);
  }
View Full Code Here

Examples of org.apache.lucene.facet.enhancements.association.AssociationFloatProperty

  @Test
  public void testEquals() {
    AssociationProperty aa1 = new AssociationIntProperty(5);
    AssociationProperty aa2 = new AssociationIntProperty(5);
    AssociationProperty aa3 = new AssociationFloatProperty(5);
    AssociationProperty aa4 = new AssociationFloatProperty(5);

    assertTrue("Should be equal", aa1.equals(aa1));
    assertTrue("Should be equal", aa1.equals(aa2));
    assertFalse("Should not be equal", aa1.equals(aa3));
    assertTrue("Should be equal", aa3.equals(aa3));
View Full Code Here

Examples of org.apache.lucene.facet.enhancements.association.AssociationFloatProperty

    // index documents, 50% have only 'b' and all have 'a'
    for (int i = 0; i < 100; i++) {
      Document doc = new Document();
      CategoryContainer container = new CategoryContainer();
      container.addCategory(aint, new AssociationIntProperty(2));
      container.addCategory(afloat, new AssociationFloatProperty(0.5f));
      if (i % 2 == 0) { // 50
        container.addCategory(bint, new AssociationIntProperty(3));
        container.addCategory(bfloat, new AssociationFloatProperty(0.2f));
      }
      builder.setCategories(container).build(doc);
      writer.addDocument(doc);
    }
   
View Full Code Here

Examples of org.apache.lucene.facet.enhancements.association.AssociationFloatProperty

    // index documents, 50% have only 'b' and all have 'a'
    for (int i = 0; i < 100; i++) {
      Document doc = new Document();
      CategoryContainer container = new CategoryContainer();
      container.addCategory(aint, new AssociationIntProperty(2));
      container.addCategory(afloat, new AssociationFloatProperty(0.5f));
      if (i % 2 == 0) { // 50
        container.addCategory(bint, new AssociationIntProperty(3));
        container.addCategory(bfloat, new AssociationFloatProperty(0.2f));
      }
      builder.setCategories(container).build(doc);
      writer.addDocument(doc);
    }
   
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.