Package org.leskes.elasticfacets.fields

Examples of org.leskes.elasticfacets.fields.HashedStringFieldType.load()


        .add(DocumentBuilder.field("svalue", "aaa")).build());

    IndexReader reader = IndexReader.open(indexWriter, true);

      HashedStringFieldType type = new HashedStringFieldType(new HashedStringFieldData.HashedStringTypeLoader(0,0, null, null));
    SingleValueHashedStringFieldData sFieldData = (SingleValueHashedStringFieldData) type.load(reader, "svalue");

    assert (sFieldData.fieldName().equals("svalue"));
    assert (!sFieldData.multiValued());
    assertThat(sFieldData.collisions(),equalTo(0));
View Full Code Here


    IndexReader reader = IndexReader.open(indexWriter, true);

      HashedStringFieldType type = new HashedStringFieldType(new HashedStringFieldData.HashedStringTypeLoader(0,0, null, null));

      SingleValueHashedStringFieldData sFieldData = (SingleValueHashedStringFieldData) type.load(reader, "svalue");

    assertThat(sFieldData.fieldName(), equalTo("svalue"));
    assertThat(sFieldData.multiValued(), equalTo(false));
    assertThat(sFieldData.collisions(),equalTo(0));
View Full Code Here

        .add(DocumentBuilder.field("mvalue", "aaa")).build());

    IndexReader reader = IndexReader.open(indexWriter, true);

      HashedStringFieldType type = new HashedStringFieldType(new HashedStringFieldData.HashedStringTypeLoader(0,0, null, null));
      MultiValueHashedStringFieldData sFieldData = (MultiValueHashedStringFieldData) type.load(reader, "mvalue");

    assert (sFieldData.fieldName().equals("mvalue"));
    assert (sFieldData.multiValued());
    assertThat(sFieldData.collisions(),equalTo(0));
View Full Code Here

      HashedStringFieldType type = new HashedStringFieldType(
              new HashedStringFieldData.HashedStringTypeLoader(0,0, excludePattern,excludeTerms));

      // we exclude the only multi value, expect a single value array
      SingleValueHashedStringFieldData sFieldData = (SingleValueHashedStringFieldData) type.load(reader, "mvalue");

      assert (sFieldData.fieldName().equals("mvalue"));
      assert (!sFieldData.multiValued());
      assertThat(sFieldData.collisions(),equalTo(0));
View Full Code Here

   
    IndexReader reader = IndexReader.open(indexWriter, true);

      HashedStringFieldType type = new HashedStringFieldType(new HashedStringFieldData.HashedStringTypeLoader(0,0, null, null));

      MultiValueHashedStringFieldData sFieldData = (MultiValueHashedStringFieldData) type.load(reader, "mvalue");
   
    assertThat(sFieldData.collisions(),equalTo(2));
    indexWriter.close();

  }
View Full Code Here

      IndexReader reader = IndexReader.open(indexWriter, true);

      HashedStringFieldType type = new HashedStringFieldType(new HashedStringFieldData.HashedStringTypeLoader(199,0, null, null));

      MultiValueHashedStringFieldData sFieldData = (MultiValueHashedStringFieldData)type.load(reader, "mvalue");

      assertThat(sFieldData.hasValue(0),equalTo(false));
      assertThat(sFieldData.hasValue(1),equalTo(true));
      indexWriter.close();
View Full Code Here

      IndexReader reader = IndexReader.open(indexWriter, true);


      HashedStringFieldType type = new HashedStringFieldType(new HashedStringFieldData.HashedStringTypeLoader(0,2, null, null));

      SingleValueHashedStringFieldData sFieldData = (SingleValueHashedStringFieldData) type.load(reader, "mvalue");

      assertThat(sFieldData.hasValue(0),equalTo(true));
      final int[] count = {0};
      sFieldData.forEachValueInDoc(0, new HashedStringFieldData.HashedStringValueInDocProc() {
         @Override
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.