public static Type convertType(DataType fieldType) {
        FieldValue fval = fieldType.createFieldValue();
        if (fieldType instanceof NumericDataType) {
            return Type.INT64;
        } else if (fval instanceof StringFieldValue) {
            return Type.TEXT;
        } else if (fval instanceof Raw) {
            return Type.BOOLEANTREE;
        } else if (fval instanceof PredicateFieldValue) {
            return Type.BOOLEANTREE;
        } else if (fieldType instanceof CollectionDataType) {
            return convertType(((CollectionDataType) fieldType).getNestedType());
        } else {
            throw new IllegalArgumentException("Don't know which index type to " +
                    "convert " + fieldType + " to");
        }
    }
Sets the right index type from a field type
config-model/src/main/java/com/yahoo/schema/derived/Index.java