use of com.qlangtech.tis.runtime.module.misc.TokenizerType in project tis by qlangtech.
the class PSchemaField method serialVisualType2Json.
@Override
public void serialVisualType2Json(JSONObject f) {
if (this.getType() == null) {
throw new IllegalStateException("field:" + this.getName() + " 's fieldType is can not be null");
}
// serialVisualType2Json(f, this.getType());
SolrFieldsParser.SolrType solrType = this.getType();
String type = solrType.getSType().getName();
TokenizerType tokenizerType = TokenizerType.parse(type);
if (tokenizerType == null) {
// 非分词字段
if (solrType.tokenizerable) {
setStringType(f, type, ReflectSchemaFieldType.STRING.literia);
} else {
f.put("split", false);
VisualType vtype = TokenizerType.visualTypeMap.get(type);
if (vtype != null) {
f.put(ISchemaField.KEY_FIELD_TYPE, vtype.getType());
return;
}
f.put(ISchemaField.KEY_FIELD_TYPE, type);
}
} else {
// 分词字段
setStringType(f, tokenizerType.getKey(), ReflectSchemaFieldType.STRING.literia);
}
// } else {
// throw new IllegalStateException("field:" + this.getName() + " 's fieldType is can not be null");
// }
}
Aggregations