Search in sources :

Example 1 with FloatField

use of org.apache.lucene.document.FloatField in project querydsl by querydsl.

the class LuceneSerializerTest method createDocument.

private Document createDocument() {
    Document doc = new Document();
    doc.add(new Field("title", new StringReader("Jurassic Park")));
    doc.add(new Field("author", new StringReader("Michael Crichton")));
    doc.add(new Field("text", new StringReader("It's a UNIX system! I know this!")));
    doc.add(new Field("rating", new StringReader("Good")));
    doc.add(new Field("publisher", "", Store.YES, Index.ANALYZED));
    doc.add(new IntField("year", 1990, Store.YES));
    doc.add(new DoubleField("gross", 900.0, Store.YES));
    doc.add(new LongField("longField", 1, Store.YES));
    doc.add(new IntField("shortField", 1, Store.YES));
    doc.add(new IntField("byteField", 1, Store.YES));
    doc.add(new FloatField("floatField", 1, Store.YES));
    return doc;
}
Also used : LongField(org.apache.lucene.document.LongField) FloatField(org.apache.lucene.document.FloatField) DoubleField(org.apache.lucene.document.DoubleField) Field(org.apache.lucene.document.Field) IntField(org.apache.lucene.document.IntField) LongField(org.apache.lucene.document.LongField) StringReader(java.io.StringReader) IntField(org.apache.lucene.document.IntField) Document(org.apache.lucene.document.Document) DoubleField(org.apache.lucene.document.DoubleField) FloatField(org.apache.lucene.document.FloatField)

Example 2 with FloatField

use of org.apache.lucene.document.FloatField in project crate by crate.

the class FloatColumnReferenceTest method insertValues.

@Override
protected void insertValues(IndexWriter writer) throws Exception {
    for (float f = -0.5f; f < 10.0f; f++) {
        Document doc = new Document();
        doc.add(new StringField("_id", Float.toString(f), Field.Store.NO));
        doc.add(new FloatField(column, f, Field.Store.NO));
        writer.addDocument(doc);
    }
}
Also used : StringField(org.apache.lucene.document.StringField) Document(org.apache.lucene.document.Document) FloatField(org.apache.lucene.document.FloatField)

Aggregations

Document (org.apache.lucene.document.Document)2 FloatField (org.apache.lucene.document.FloatField)2 StringReader (java.io.StringReader)1 DoubleField (org.apache.lucene.document.DoubleField)1 Field (org.apache.lucene.document.Field)1 IntField (org.apache.lucene.document.IntField)1 LongField (org.apache.lucene.document.LongField)1 StringField (org.apache.lucene.document.StringField)1