Examples of StringField


Examples of org.apache.lucene.document.StringField

    conf.setMaxBufferedDocs(4);
    IndexWriter writer = new IndexWriter(dir, conf);
    final int numDocs = atLeast(10);
    for (int i = 0; i < numDocs; i++) {
      Document doc = new Document();
      doc.add(new StringField("id", "doc" + i, Store.NO));
      long value = random().nextInt();
      doc.add(new NumericDocValuesField("f", value));
      doc.add(new NumericDocValuesField("cf", value * 2));
      writer.addDocument(doc);
    }
View Full Code Here

Examples of org.apache.lucene.document.StringField

        return new Lucene45DocValuesFormat();
      }
    });
    IndexWriter writer = new IndexWriter(dir, conf.clone());
    Document doc = new Document();
    doc.add(new StringField("id", "d0", Store.NO));
    doc.add(new NumericDocValuesField("f1", 5L));
    doc.add(new NumericDocValuesField("f2", 13L));
    writer.addDocument(doc);
    writer.close();
   
    // change format
    conf.setCodec(new Lucene46Codec() {
      @Override
      public DocValuesFormat getDocValuesFormatForField(String field) {
        return new AssertingDocValuesFormat();
      }
    });
    writer = new IndexWriter(dir, conf.clone());
    doc = new Document();
    doc.add(new StringField("id", "d1", Store.NO));
    doc.add(new NumericDocValuesField("f1", 17L));
    doc.add(new NumericDocValuesField("f2", 2L));
    writer.addDocument(doc);
    writer.updateNumericDocValue(new Term("id", "d0"), "f1", 12L);
    writer.close();
View Full Code Here

Examples of org.apache.lucene.document.StringField

    }

    // create first index
    for (int i = 0; i < numDocs; i++) {
      Document doc = new Document();
      doc.add(new StringField("id", RandomPicks.randomFrom(random(), randomTerms), Store.NO));
      doc.add(new NumericDocValuesField("ndv", 4L));
      doc.add(new NumericDocValuesField("control", 8L));
      writer.addDocument(doc);
    }
   
View Full Code Here

Examples of org.apache.lucene.document.StringField

    Directory dir = newDirectory();
    IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
    IndexWriter writer = new IndexWriter(dir, conf);
   
    Document doc = new Document();
    doc.add(new StringField("id", "d0", Store.NO));
    doc.add(new NumericDocValuesField("f", 1L));
    writer.addDocument(doc);

    // create first gen of update files
    writer.updateNumericDocValue(new Term("id", "d0"), "f", 2L);
View Full Code Here

Examples of org.molgenis.fieldtypes.StringField

    MolgenisFieldTypes.addType(new FileField());
    MolgenisFieldTypes.addType(new ImageField());
    MolgenisFieldTypes.addType(new HyperlinkField());
    MolgenisFieldTypes.addType(new LongField());
    MolgenisFieldTypes.addType(new MrefField());
    MolgenisFieldTypes.addType(new StringField());
    MolgenisFieldTypes.addType(new TextField());
    MolgenisFieldTypes.addType(new XrefField());
    MolgenisFieldTypes.addType(new IntField());
  }
View Full Code Here

Examples of org.springframework.roo.classpath.operations.jsr303.StringField

                .getTypeDetails(typeName);
        Validate.notNull(cid, "The type specified, '%s', doesn't exist",
                typeName);

        final String physicalTypeIdentifier = cid.getDeclaredByMetadataId();
        final StringField fieldDetails = new StringField(
                physicalTypeIdentifier, fieldName);
        fieldDetails.setNotNull(notNull);
        fieldDetails.setNullRequired(nullRequired);
        if (decimalMin != null) {
            fieldDetails.setDecimalMin(decimalMin);
        }
        if (decimalMax != null) {
            fieldDetails.setDecimalMax(decimalMax);
        }
        if (sizeMin != null) {
            fieldDetails.setSizeMin(sizeMin);
        }
        if (sizeMax != null) {
            fieldDetails.setSizeMax(sizeMax);
        }
        if (regexp != null) {
            fieldDetails.setRegexp(regexp.replace("\\", "\\\\"));
        }
        if (column != null) {
            fieldDetails.setColumn(column);
        }
        if (comment != null) {
            fieldDetails.setComment(comment);
        }
        if (unique) {
            fieldDetails.setUnique(true);
        }
        if (value != null) {
            fieldDetails.setValue(value);
        }

    if (lob) {
      fieldDetails.getInitedAnnotations().add(
          new AnnotationMetadataBuilder("javax.persistence.Lob"));
    }
        insertField(fieldDetails, permitReservedWords, transientModifier);
    }
View Full Code Here

Examples of org.ytreza.data.model.modelField.StringField

    super();
  }
 
  @Override
  public void initializeFields() {
    fieldString = (StringField) addField(new StringField(FIELD_STRING));
    fieldDate = (DateField) addField(new DateField(FIELD_DATE, null));
  }
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.