Example usage for org.apache.lucene.document StringField fieldType

List of usage examples for org.apache.lucene.document StringField fieldType

Introduction

In this page you can find the example usage for org.apache.lucene.document StringField fieldType.

Prototype

@Override
public IndexableFieldType fieldType() 

Source Link

Document

Returns the FieldType for this field.

Usage

From source file:org.apache.blur.mapreduce.lib.v2.DocumentWritable.java

License:Apache License

private void writeStringField(DataOutput out, StringField stringField) throws IOException {
    FieldType fieldType = stringField.fieldType();
    if (fieldType.equals(StringField.TYPE_STORED)) {
        out.writeBoolean(true);/*  w w  w  .java  2s.c  om*/
    } else if (fieldType.equals(StringField.TYPE_NOT_STORED)) {
        out.writeBoolean(false);
    } else {
        throw new IOException("Non default FieldTypes for StringField not supported.");
    }
    writeString(out, stringField.stringValue());
}