use of com.xiaomi.linden.thrift.common.LindenFieldSchema in project linden by XiaoMi.
the class LindenScoreModelStrategy method preProcess.
public void preProcess(AtomicReaderContext context, LindenSchema schema, LindenScoreModel scoreModel) {
this.context = context;
fieldSchemaMap = new HashMap<>();
for (LindenFieldSchema fieldSchema : schema.getFields()) {
fieldSchemaMap.put(fieldSchema.getName(), fieldSchema);
}
// add id field
if (!fieldSchemaMap.containsKey(schema.getId())) {
LindenFieldSchema idFieldSchema = new LindenFieldSchema();
idFieldSchema.setName(schema.getId());
idFieldSchema.setType(LindenType.STRING);
idFieldSchema.setIndexed(true);
idFieldSchema.setOmitNorms(true);
idFieldSchema.setOmitFreqs(true);
idFieldSchema.setStored(true);
idFieldSchema.setTokenized(false);
fieldSchemaMap.put(schema.getId(), idFieldSchema);
}
this.scoreModel = scoreModel;
}
Aggregations