Examples of FloatField


Examples of com.jengine.orm.model.field.numeric.FloatField

        } else if (entityClass.equals(Integer.class) || entityClass.equals(int.class)) {
            field = new IntegerField();
        } else if (entityClass.equals(Long.class) || entityClass.equals(long.class) ) {
            field = new LongField();
        } else if (entityClass.equals(Float.class) || entityClass.equals(float.class)) {
            field = new FloatField();
        } else if (entityClass.equals(Double.class) || entityClass.equals(double.class)) {
            field = new DoubleField();
        } else if (entityClass.equals(Date.class)) {
//            field = new DateTimeField();
            field = new DateTimeField(Timestamp.class, CollectionUtil.map());
View Full Code Here

Examples of org.apache.lucene.document.FloatField

      if (random().nextBoolean()) {
        // float/double
        if (random().nextBoolean()) {
          final float f = random().nextFloat();
          answer = Float.valueOf(f);
          nf = new FloatField("nf", f, Field.Store.NO);
          sf = new StoredField("nf", f);
          typeAnswer = NumericType.FLOAT;
        } else {
          final double d = random().nextDouble();
          answer = Double.valueOf(d);
View Full Code Here

Examples of org.apache.lucene.document.FloatField

    List<Field> fields = Arrays.asList(
        new Field("bytes", bytes, ft),
        new Field("string", string, ft),
        new LongField("long", l, Store.YES),
        new IntField("int", i, Store.YES),
        new FloatField("float", f, Store.YES),
        new DoubleField("double", d, Store.YES)
    );

    for (int k = 0; k < 100; ++k) {
      Document doc = new Document();
View Full Code Here

Examples of org.apache.lucene.document.FloatField

  }

  @Override
  public Iterable<? extends Field> getFieldsForColumn(String family, Column column) {
    String name = getName(family, column.getName());
    FloatField field = new FloatField(name, Float.parseFloat(column.getValue()), _typeStored);
    return makeIterable(field);
  }
View Full Code Here

Examples of org.apache.lucene.document.FloatField

  }

  @Override
  public Iterable<? extends Field> getFieldsForSubColumn(String family, Column column, String subName) {
    String name = getName(family, column.getName(), subName);
    return makeIterable(new FloatField(name, Float.parseFloat(column.getValue()), _typeNotStored));
  }
View Full Code Here

Examples of org.apache.lucene.document.FloatField

      document.add(newStringField("byte", "" + ((byte) random().nextInt()), Field.Store.NO));
      document.add(newStringField("short", "" + ((short) random().nextInt()), Field.Store.NO));
      document.add(new IntField("int", random().nextInt(), Field.Store.NO));
      document.add(new LongField("long", random().nextLong(), Field.Store.NO));

      document.add(new FloatField("float", random().nextFloat(), Field.Store.NO));
      document.add(new DoubleField("double", random().nextDouble(), Field.Store.NO));

      document.add(new NumericDocValuesField("intdocvalues", random().nextInt()));
      document.add(new FloatDocValuesField("floatdocvalues", random().nextFloat()));
      iw.addDocument(document);
View Full Code Here

Examples of org.apache.lucene.document.FloatField

          break;
        case LONG:
          f = new LongField(name, 0L, Field.Store.NO);
          break;
        case FLOAT:
          f = new FloatField(name, 0.0F, Field.Store.NO);
          break;
        case DOUBLE:
          f = new DoubleField(name, 0.0, Field.Store.NO);
          break;
        default:
View Full Code Here

Examples of org.apache.lucene.document.FloatField

      document.add(newStringField("byte", "" + ((byte) random().nextInt()), Field.Store.NO));
      document.add(newStringField("short", "" + ((short) random().nextInt()), Field.Store.NO));
      document.add(new IntField("int", random().nextInt(), Field.Store.NO));
      document.add(new LongField("long", random().nextLong(), Field.Store.NO));

      document.add(new FloatField("float", random().nextFloat(), Field.Store.NO));
      document.add(new DoubleField("double", random().nextDouble(), Field.Store.NO));
      document.add(newStringField("bytes", _TestUtil.randomRealisticUnicodeString(random()), Field.Store.NO));
      document.add(newStringField("bytesval", _TestUtil.randomRealisticUnicodeString(random()), Field.Store.NO));
      document.add(new DoubleField("double", random().nextDouble(), Field.Store.NO));
View Full Code Here

Examples of org.apache.lucene.document.FloatField

  public void testInfiniteValues() throws Exception {
    Directory dir = newDirectory();
    RandomIndexWriter writer = new RandomIndexWriter(random(), dir,
      newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random())));
    Document doc = new Document();
    doc.add(new FloatField("float", Float.NEGATIVE_INFINITY, Field.Store.NO));
    doc.add(new IntField("int", Integer.MIN_VALUE, Field.Store.NO));
    writer.addDocument(doc);
   
    doc = new Document();
    doc.add(new FloatField("float", Float.POSITIVE_INFINITY, Field.Store.NO));
    doc.add(new IntField("int", Integer.MAX_VALUE, Field.Store.NO));
    writer.addDocument(doc);
   
    doc = new Document();
    doc.add(new FloatField("float", 0.0f, Field.Store.NO));
    doc.add(new IntField("int", 0, Field.Store.NO));
    writer.addDocument(doc);
   
    for (float f : TestNumericUtils.FLOAT_NANs) {
      doc = new Document();
      doc.add(new FloatField("float", f, Field.Store.NO));
      writer.addDocument(doc);
    }
   
    writer.close();
   
View Full Code Here

Examples of org.apache.lucene.document.FloatField

    for(int i=0;i<numDocs;i++) {
      Document doc = new Document();
      float v = random().nextFloat();
      values[i] = v;
      doc.add(new FloatDocValuesField("field", v));
      doc.add(new FloatField("field", v, Field.Store.NO));
      w.addDocument(doc);
    }
    IndexReader r = w.getReader();
    w.close();
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.